We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi,
I'm trying to use inline assembler code but the keyword '__asm' is not accepted. I can create an '__asm' function with no compiler warnings but when calling this function the uC restarts. Using Cortex M3 device.
Regards,
Henk
Executing the flash sequence like unlocking all works fine. If I erase some flash section containing code then the verify function shows that code has changed. If I erase the lowest page containing my small test application then is does not start on reset because it is erased.
When writing data to flash memory the verify function reports that verify is okay, which should not be so if data was really written to flash.
This is my write function:
void vWriteAddressX16BitsValueY(int iAdd,short sDta){ //var short* sp; //select address sp=(short*)iAdd; //write data *sp=sDta; }
Checking some flash write error bit shows that no error occured. But as said: no dat is written.
As far as I know, you cannot write into internal flash like this. Did you check your user manual - are you allowed to write into flash like this...? On a LPC2478, this will cause an immediate failure. If not, you need to search your user manual for "IAP".
And you don't need any assembly to write a bootloader, at least not on a LPC2467/78/1768 !
>As far as I know, you cannot write into internal flash >like this. Did you check your user manual - are you
Yes you can, but first have to follow some unlock sequence which works fine otherwise it would not be possible to erase pages as is done.