Author Topic: MSD and binary file are not working together  (Read 15316 times)

Offline Jorge

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: MSD and binary file are not working together
« Reply #15 on: July 14, 2016, 12:02:38 AM »
Hi Mark!

I´m retaking the project, I already can manipulate the headers, but the app it is still not compatible with utasker. The headers are 0x2000fc00 (stack pointer initial number) and 0x8b41 (the program counter initial value) as you said. I can manipulate the program counter initial value changing origin of the m_text section.
I notice something weird , 873d it is constantly repeatedly.
Can you get me some feedback?

Regards

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: MSD and binary file are not working together
« Reply #16 on: July 14, 2016, 01:17:50 AM »
Hi Jorge

The pattern that you see at the start of the code are default interrupt handlers that the code (controlling the reset and interrupt vectors in your project). These are presumably all "pointers" to a handling routine at 0x0000873d that is caled in case an unexpetced interrupt fires.
Since there are no other values it means that there are no specific interrupt vectors prepared and it tells me that your project presumably copies these default values to internal SRAM, changes the VBR to point to the location and then any specific interrupts are entered in the SRAM when needed - overwriting the default handlers.
The alternative is that the project doesn't enable and use any interrupts.

Regards

Mark

Offline Jorge

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: MSD and binary file are not working together
« Reply #17 on: July 14, 2016, 05:49:54 PM »
Hi Mark!

I´m looking for a function that jump into the "m_text" section memory, I´m trying to match the "tags" of the sections memory of the utasker code and my test aplication.
Do you know the function or the tags that jump to the application in my uC? or how I can match the utasker and my app?
I am saying this because I found a piece of code in the Document Number: AN4498 of NXP: CodeWarrior Linker Command File (LCF) for Kinetis.

Thanks!
Regards
« Last Edit: July 14, 2016, 06:00:24 PM by Jorge »

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: MSD and binary file are not working together
« Reply #18 on: July 15, 2016, 11:32:37 AM »
Jorge

The uTasker serial loader jumps to the application using the call

start_application(_UTASKER_APP_START_);                          // jump to the application

_UTASKER_APP_START is the address of the reset vector table in the application.

This does it in assembler as follows (for Cortex m3/m4 processors):

// Allow the jump to a foreign application as if it were a reset (load SP and PC)
//
extern void start_application(unsigned long app_link_location)
{
    asm(" ldr sp, [r0,#0]");                                             // load the stack pointer value from the program's reset vector
    asm(" ldr pc, [r0,#4]");                                             // load the program counter value from the program's reset vector to cause operation to continue from there
}

Regards

Mark