Hi,
Any update on the above issue (for relocating chibios to different sector).
ChibiOS crashes when my firmware is not at beginning of flash memory
Moderators: RoccoMarco, barthess
- Giovanni
- Site Admin
- Posts: 14462
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1078 times
- Been thanked: 922 times
- Contact:
Re: ChibiOS crashes when my firmware is not at beginning of flash memory
I don't have information to give a meaningful suggestion.
Others have implemented a similar bootloader so there must something wrong is some minor detail.
Giovanni
Others have implemented a similar bootloader so there must something wrong is some minor detail.
Giovanni
Re: ChibiOS crashes when my firmware is not at beginning of flash memory
Hi,
After changing the following info in STM32F407xG.ld file, my vector in ch.list file now points to sector 5 which I think is correct. But still the code is not getting started.
STM32F407xG.ld file :
flash0 : org = 0x08020000, len = 512k
ch.list file :
Disassembly of section .vectors:
08020000 <_vectors>:
8020000: 20000400 .word 0x20000400
8020004: 080202d9 .word 0x080202d9
8020008: 080202db .word 0x080202db
Someone shared that "set CORTEX_VTOR_INIT to the new offset". But I did not find this Macro in my chibios code.
After changing the following info in STM32F407xG.ld file, my vector in ch.list file now points to sector 5 which I think is correct. But still the code is not getting started.
STM32F407xG.ld file :
flash0 : org = 0x08020000, len = 512k
ch.list file :
Disassembly of section .vectors:
08020000 <_vectors>:
8020000: 20000400 .word 0x20000400
8020004: 080202d9 .word 0x080202d9
8020008: 080202db .word 0x080202db
Someone shared that "set CORTEX_VTOR_INIT to the new offset". But I did not find this Macro in my chibios code.
- Giovanni
- Site Admin
- Posts: 14462
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1078 times
- Been thanked: 922 times
- Contact:
Re: ChibiOS crashes when my firmware is not at beginning of flash memory
If you are using the latest version then VTOS is set in startup files, no need for that option.
Giovanni
Giovanni
Re: ChibiOS crashes when my firmware is not at beginning of flash memory
Hi,
I am using the following version of chibios. In this version is it necessary to set CORTEX_VTOR_INIT
/*
* @brief ChibiOS version string.
*/
#define CH_VERSION "19.1.2"
Thanks
I am using the following version of chibios. In this version is it necessary to set CORTEX_VTOR_INIT
/*
* @brief ChibiOS version string.
*/
#define CH_VERSION "19.1.2"
Thanks
- Giovanni
- Site Admin
- Posts: 14462
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1078 times
- Been thanked: 922 times
- Contact:
Re: ChibiOS crashes when my firmware is not at beginning of flash memory
It is not necessary.
Giovanni
Giovanni
Re: ChibiOS crashes when my firmware is not at beginning of flash memory
Hi,
Any inputs from your side for relocating the chibios to different sector(Any extra changes to be made in code).
Thanks
Any inputs from your side for relocating the chibios to different sector(Any extra changes to be made in code).
Thanks
- Giovanni
- Site Admin
- Posts: 14462
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1078 times
- Been thanked: 922 times
- Contact:
Re: ChibiOS crashes when my firmware is not at beginning of flash memory
No changes, you just need to change the LD file and make sure that you enter ChibiOS under the same conditions you have after exiting a reset (interrupts disabled, peripherals in their reset state etc).
Giovanni
Giovanni
Re: ChibiOS crashes when my firmware is not at beginning of flash memory
Hi,
I carried out some test and got the results. This might help in getting a clear idea why chibios is not able to relocate to different sector.
For example : I made a bootloader code in HAL and a simple application code in HAL, then it is working.
Bootloader code Application code Result
1. HAL HAL Working
2. Chibios Chibios Working
3. HAL Chibios Not Working
4. Chibios HAL Not Working
Any idea from your side. The final application code is chibios.
Thanks
I carried out some test and got the results. This might help in getting a clear idea why chibios is not able to relocate to different sector.
For example : I made a bootloader code in HAL and a simple application code in HAL, then it is working.
Bootloader code Application code Result
1. HAL HAL Working
2. Chibios Chibios Working
3. HAL Chibios Not Working
4. Chibios HAL Not Working
Any idea from your side. The final application code is chibios.
Thanks
- wurstnase
- Posts: 121
- Joined: Tue Oct 17, 2017 2:24 pm
- Has thanked: 43 times
- Been thanked: 30 times
- Contact:
Re: ChibiOS crashes when my firmware is not at beginning of flash memory
I successfully jump from HAL bootloader to ChibiOS main application.
Be sure that you will set VTOR, MSP etc. correctly AND jump before halInit and chInit etc.
Be sure that you will set VTOR, MSP etc. correctly AND jump before halInit and chInit etc.
\o/ Nico
Who is online
Users browsing this forum: No registered users and 7 guests