Code Monkey home page Code Monkey logo

Comments (5)

akospasztor avatar akospasztor commented on May 22, 2024 1

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:

  1. Check if the flashed application code is written properly into the MCU flash. Is the application binary written properly, to the right location?
  2. 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
  3. 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.

akospasztor avatar akospasztor commented on May 22, 2024 1

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.

Rajkumar181 avatar Rajkumar181 commented on May 22, 2024

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.

Rajkumar181 avatar Rajkumar181 commented on May 22, 2024

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.

stale avatar stale commented on May 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.