Hi all,
I'm currently working with a MSP430F1612 MCU based device which is running a small operating system in it. In the flash memory of the MCU there's enough space remaining after the point where the operating system image resides. What I'm going to do is copying another executable file into the remaining space in the flash memory and run it independently without overwriting OS. New executable file is coming from an SD card attached the mobile device. A program running with the operating system will copy that executable file from the SD card to the remaining space in flash.
Up to now we have been able to write an application which can access the SD card and copy its content byte by byte to the empty space in flash memory of the MCU. However when we jump to the starting address of the new executable image from the operating system code, the MCU gets reset. Still we couldn't figure out which went wrong.
I doubt that the executable file might not have written to the flash memory properly. When writing to the flash we used a "long pointer variable" which contains the starting address of the memory location (0xa000 in this case) where we need our executable program laid. Then while copying each byte of the file in SD card to our pointed location we increment the pointer variable in a loop. I think our executable files bytes get scattered in the flash memory without writing continuously since our pointer variable is too large (data type is long). But I couldn't use a smaller data type pointer since it has to keep a large memory address.
(OS image begins at 0x2500 location and it ends somewhere before 0xa000. From that point I need my new program to run independently from OS. So I'm jumping to 0xa000 location from OS code)
Have I done anything wrong there or is this a possible thing that I'm trying to do? Any comments are welcome.
Thanks!