Author Topic: Bootloader for Kinetis and interrupts problem  (Read 74 times)

Offline LuisHS

  • Newbie
  • *
  • Posts: 21
    • View Profile
Bootloader for Kinetis and interrupts problem
« on: March 10, 2020, 10:52:05 AM »
Hello Mark.

I have a problem using the bootloader by SD card. My program works perfectly if I burn it directly to the microcontroller, a Kinetis MK66, using a Jlink.

But if I load it using the bootloader, the start of the program, that turns on/off several LEDs of a LED matrix works perfectly, so I know that the program has been loaded and is running. But what runs next in the program does not work, several GPIOs activated by interrupts must be read.

Is there anything to consider using the uTasker SD bootloader, if the program to be loaded uses interrupts?.  I tried to compile my program generating Debug and Release versions, with optimization disabled, program start address always 0x8000.
« Last Edit: March 10, 2020, 10:56:26 AM by LuisHS »

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3035
    • View Profile
    • uTasker
Re: Bootloader for Kinetis and interrupts problem
« Reply #1 on: March 10, 2020, 01:50:51 PM »
Luis

Check Appendix B of the serial loader document for a check-list for compatibility:
https://www.utasker.com/docs/uTasker/uTaskerSerialLoader.pdf

When the loader starts the application it performs:
uDisable_Interrupt();                                        // ensure interrupts are disabled when jumping to the application
RESET_PERIPHERALS();                                         // reset peripherals and disable interrupts ready for jumping to the application
start_application(_UTASKER_APP_START_);                      // jump to the application


The macro RESET_PERIPERALS() ensures that any possible pending interrupts are cleared but you can check to see whether it may need to do something more to ensure your application isn't disturbed by previous peripheral usage.

Regards

Mark