Other Parts Discussed in Thread: UNIFLASH, ENERGIA, CC3200
in a custom board with CC3220S I need to be able to start 2 different applications
in flash memory, the executables of these 2 applications must be separated (App1.bin and App2.bin)
to do this, I have developed a custom 2nd level bootloader which, after having established which application must be executed, loads it into RAM and run it
- my booloader occupies addresses 0x20004000-0x2001285F
- applications are built to reside starting at address 0x20014000 (so there is no overlap with my boot)
- the .resetVecs element is placed in 0x20014000 (value forced in linker cmd file)
- the resetISR is placed in 0x200302d5 (value read from the map file)
My boot starts successfully and copies (for example) App1 from flash to RAM starting from 0x20014000
To run the application I use the following assembler lines, forcing the register R0 = 0x20014000 (= address of the .resetVecs of the application)
- ldr sp,[r0] --> reset the stack pointer to the initial value
- add r0,r0,#4 --> increases R0 by 4 (R0 = 0x20014004)
- ldr r1,[r0] --> in 0x20014004 there is the address of the resetISR of the application, which is copied in R1
- bx r1 --> jump to the address contained in R1 (then the address of the application's resetISR is stored in the Program Counter)
Using the built-in debugger in Code Composer Studio 12, everything looks fine but the application doesn't run...
I integrate everything into the flash memory, using UniFlash 8
- my bootloader is the MCU Image
- the application is inserted as User File in /sys/app1.bin (the same path used by mu boot to load it)
After program and restart:
- the boot starts
- the application is loaded in RAM (with a CRC32 control to make sure it is loaded correctly)
- the previous assembler lines are executed successfully
... but the application deosn't start.
For the application I tried to save both the debug version and the MCU+Image version in flash, but nothing changes
What am I doing wrong?
Thank you, Andrea