Thanks for the suggestion, Jerome. As you suggested, I tried passing the value with $, like below asm(" SWI $458752");
But it did not worked. Then, In some link in internet , I found out that, my arm cross compiler(arm-linux-gnueabi-gcc) automatically generates thumb instructions, and somehow this instruction is not supported with that. So, I just added "-marm" in the compiler option, to not to generate thumb instructions and it worked out. Now, I am not getting this error, and it compiled perfectly. Thanks for your help. Regards, On Sunday, August 3, 2014 11:26:11 PM UTC+5:30, Jerome wrote: > > The SWI op code accepts a 24 bit immedtiate operand, which is assembled as > its lower 24 bits. The interrupt routine called by SWI extracts it and > interprets it. Perhaps you need to indicate its an immediate value using > your assemblers syntax. > On Aug 2, 2014 5:30 PM, "William Hermans" <yyr...@gmail.com <javascript:>> > wrote: > >> Except that the value passed in as is will have to be between 0 and >> 65535( max range for a 16bit type ). >> >> >> On Sat, Aug 2, 2014 at 3:28 PM, William Hermans <yyr...@gmail.com >> <javascript:>> wrote: >> >>> Manish, >>> >>> I have no idea how the underlying code uses this value so I could not >>> give an 100% accurate answer. >>> >>> >>> On Sat, Aug 2, 2014 at 8:59 AM, manish <manish...@gmail.com >>> <javascript:>> wrote: >>> >>>> So, what value I should use to enable privileged mode of >>>> BeagleBoneBlack? >>>> >>>> void CPUSwitchToPrivilegedMode(void) >>>> { >>>> asm(" SWI ??????"); >>>> } >>>> >>>> On Saturday, August 2, 2014 6:01:30 PM UTC+5:30, William Hermans wrote: >>>> >>>>> *Can anyone help me to fix this problem? Is it a gcc compiler issue or >>>>>> issue with the code.* >>>>>> >>>>> >>>>> Aside from 458752 being about 7 times to big to fit in a 16 bit field ? >>>>> >>>>> >>>>> On Sat, Aug 2, 2014 at 4:00 AM, manish <manish...@gmail.com> wrote: >>>>> >>>>>> >>>>>> Hi, >>>>>> >>>>>> I am trying to compile the uart code comes >>>>>> with AM335X_StarterWare_02_00_01_01 for BeagleBoneBlack. >>>>>> But I get below error : >>>>>> >>>>>> /tmp/ccKSsL5N.s:43: Error: invalid swi expression >>>>>> /tmp/ccKSsL5N.s:43: Error: value of 0000000000070000 too large for >>>>>> field of 2 bytes at 0000000000000004 >>>>>> >>>>>> >>>>>> this error comes for the below code: >>>>>> >>>>>> ************************************************************ >>>>>> ******************/ >>>>>> /** >>>>>> * \brief This API can be used to switch from user mode to >>>>>> privileged mode >>>>>> * The priviledge mode will be system mode. System mode >>>>>> will share >>>>>> * the same resources as user mode, but with privileges. >>>>>> * >>>>>> * \param None. >>>>>> * >>>>>> * \return None. >>>>>> * >>>>>> * Note : All the access to system configuration which needs >>>>>> privileged access >>>>>> * can be done after calling this API. >>>>>> **/ >>>>>> void CPUSwitchToPrivilegedMode(void) >>>>>> { >>>>>> asm(" SWI 458752"); >>>>>> } >>>>>> >>>>>> I do not see any issue with this instructions as the last bits should >>>>>> be set to 1 to operate in privileged mode. >>>>>> Please refer http://www.riscos.com/support/developers/prm/swis. >>>>>> html#57602 >>>>>> >>>>>> Can anyone help me to fix this problem? Is it a gcc compiler issue or >>>>>> issue with the code. >>>>>> >>>>>> Thanks & Regards, >>>>>> Manish >>>>>> >>>>>> -- >>>>>> For more options, visit http://beagleboard.org/discuss >>>>>> --- >>>>>> You received this message because you are subscribed to the Google >>>>>> Groups "BeagleBoard" group. >>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>> send an email to beagleboard...@googlegroups.com. >>>>>> >>>>>> For more options, visit https://groups.google.com/d/optout. >>>>>> >>>>> >>>>> -- >>>> For more options, visit http://beagleboard.org/discuss >>>> --- >>>> You received this message because you are subscribed to the Google >>>> Groups "BeagleBoard" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to beagleboard...@googlegroups.com <javascript:>. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> >> -- >> For more options, visit http://beagleboard.org/discuss >> --- >> You received this message because you are subscribed to the Google Groups >> "BeagleBoard" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to beagleboard...@googlegroups.com <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.