2023-05-12 08:30 AM
2023-05-15 11:02 AM
Why would they be different from the 'F051 case?
JW
2023-05-15 11:17 AM
If they are machine code, probably that the CM0 has a significantly reduced instruction set and flexibility.
I don't think you can load SP directly, you have to move to r[0..7] one first, and the move over
ie
LDR R0, [R0, #0]
MOV SP,R0
vs
LDR SP,[R0, #0]
2023-05-15 11:19 AM
The array of things you change has to be 0x20000000
This mirrors or shadows at 0x00000000
2023-05-15 11:29 AM
Because it is ;)
It works on STM32F051, it doedn't on STM32L151
2023-05-19 08:41 AM
Y Tesla DeLorean
Thanks a lot for answering to me, it seems it's quite difficult to have solutions for this kind of problem.
#define BOOTLOADER_ADRESS 0x5B000
#define VECT_OFFSET 0x00
#define PROGRAM1_ADDR_VECTORS 0x400 // ... <0x326FF
#define PROGRAM2_ADDR_VECTORS 0x2E000 // ... <0x5B000
What I did
void JumpToAddress(unsigned long addr)
{
typedef void (*FunctionPointer)(void);
FunctionPointer functionPtr = (FunctionPointer)addr;
functionPtr();
}
void TestJump()
{
unsigned long x4;
union
{
unsigned long addr;
FunctionPointer funcPtr;
} jump;
jump.addr = PROGRAM1_ADDR_VECTORS;
SCB_VTOR = PROGRAM1_ADDR_VECTORS;
WHILE1LEDXX // this line will do LED flashing. I can see PC register is in bootloader area, not in program area
JumpToAddress(jump.addr); //if no line "WHILE1LEDXX" I will see PC register is in program area but nothing happen.
delay_ms(3000);
}
I suppose VTOR must have PC vectors value but it seem it doesn't here
If you have solution ....
2023-05-20 09:51 AM
Update: it's OK now !!
I can use a bootloader, writed with StmCubeIde and launch a program writed with MikroC