Comments (5)
Hey there,
first of all, let me kindly tell you that I've been writing and developing these projects for my own education / hobby / entertainment / etc., and I've decided to publish them because I believe it might be useful and beneficial for many other people. I always try to provide sufficient and detailed documentation, alongside with detailed comments in the source code, so that people can easily continue and customize my projects and examples to their taste. I always welcome any kind of feedback, feature request, etc., and I always try to answer to all of the questions and issues within a reasonable time. I am happy to help people and provide guidelines to the best of my knowledge to solve their problems. However, please understand that I don't have any resources, nor time to do any code review or write code for another person.
With that being said, I would recommend to perform the followings:
- Check if the flashed application code is written properly into the MCU flash. Is the application binary written properly, to the right location?
- In order to perform a successful jump, the following operations need to be performed:
- reset all peripherals to their reset state
- disable systick (if running)
- make sure there isn't any interrupt pending to be served
- set the new vector table location
- set the stack pointer
- jump
- Try to debug and step the jump, and observe what happens exactly, what does the MCU. Do you jump to the correct location?
Let me know if this helps.
Best,
Akos
from stm32-bootloader.
When you set the stack pointer, you have to set it to the value defined at the very first 32-bit dword of your application. If you write __set_MSP((APP_ADDRESS));
then you set the stack pointer to the address of your application and not to the value pointed by this address.
Therefore, the correct solution would be: __set_MSP(*(__IO uint32_t*)APP_ADDRESS);
from stm32-bootloader.
Thanks for your support.
I followed your suggestion but I am not able to jump the correct location. Sorry, I am turbling to you.
my MCU is - STM32F429zi
This my jump code
___disable_irq();
uint32_t JumpAddress = ((__IO uint32_t)(APP_ADDRESS + 4));
pFunction Jump = (pFunction)JumpAddress;
HAL_RCC_DeInit();
HAL_DeInit();
SysTick->CTRL = 0;
SysTick->LOAD = 0;
SysTick->VAL = 0;
SCB->VTOR = APP_ADDRESS;
__set_MSP((__IO uint32_t)(APP_ADDRESS));
Jump();
from stm32-bootloader.
When I tried in a different way, it is jumping to the correct location but still, the problem is same.
__disable_irq();
uint32_t JumpAddress = ((APP_ADDRESS + 4));
pFunction Jump = (pFunction)JumpAddress;
HAL_RCC_DeInit();
HAL_DeInit();
SysTick->CTRL = 0;
SysTick->LOAD = 0;
SysTick->VAL = 0;
#if (SET_VECTOR_TABLE)
SCB->VTOR = APP_ADDRESS;
#endif
__set_MSP((APP_ADDRESS));
Jump();
Why we are doing pointer cast?
from stm32-bootloader.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
from stm32-bootloader.
Related Issues (20)
- Add command line argument to provide path to clang-format
- Add support for GNU Arm Embedded Toolchain
- Fix clang-format issue on CI HOT 1
- Add GCC build job to CI pipeline
- Add support for building the projects with scons
- Linker Script Question HOT 2
- Add stale bot to repository
- Add yamllint to repository HOT 1
- Update clang-format version to 11
- Add pull request template
- CI: Use docker image for jobs
- CI: Add style check job
- Support for STM32F4 series HOT 2
- How to build the firmware image HOT 4
- OTA firmware update on stm8s HOT 2
- Not an issue - a question - SCB->VTOR issue with F103? HOT 3
- use of stm32-Bbootloader HOT 1
- CI: Fix editorconfig-checker command not found issue
- HardFault at f_read HOT 1
- Is it a bug in function Bootloader_Erase()? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stm32-bootloader.