USB bootloader, AN3927, and MQZ 3.7

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

USB bootloader, AN3927, and MQZ 3.7

Jump to solution
880 Views
barbercolman
Contributor III

I am looking at adding a USB to a MCF51jm 128. Looking through this forum I found a few references to MQZ and this AN, but they will several years old. Has anyon tried AN39277 and current tools?

 

Any comments or suggestions?

 

Thanks

0 Kudos
Reply
1 Solution
547 Views
DavidS
NXP Employee
NXP Employee

Hi Barber,

Good timing of question.  I've just helped someone else get this running with FSLMQX3.7 and M52259DEMO.

I found issue that I haven't found the root cause of yet but did find workaround to get the jump table working correctly.

I simple created a new "C" file to contain:

asm void jumptable(void);

extern unsigned long __boot;

    #pragma define_section jump_rom ".jumprom" far_absolute R
__declspec (jump_rom) asm void jumptable(void)
{
 nop
 jmp __boot 
}

 

Then added it to the application I want to load into FLASH.

 

The linker is updated with the following:

MEMORY
{
   jumprom     (RX): ORIGIN = 0x00004000, LENGTH = 0x00000010

...

 

KEEP_SECTION { .jumprom, .vectors_rom, .vectors_ram, .cfmconfig }

 

 .jumprom :
 {
        ___JUMP_ROM_START = .;  # Jump table
  jump_rom.c(.jumprom)
  . = ALIGN (0x4);
 } > jumprom

 

Lastly with the above changes you DO NOT need to have the following code used:

    #pragma define_section jump_rom ".jump_rom" far_absolute R
__declspec(jump_rom) const unsigned char _UserEntry[] @ USER_ENTRY_ADDRESS = {
  0x4E,
  0x71,
  0x4E,
  0xF9           //asm NOP(0x4E71), asm JMP(0x4EF9)          
};

__declspec(jump_rom) void  (* const _UserEntry2[])()@(USER_ENTRY_ADDRESS+4)=
{
  __boot,
};

 

 

This is the code snippet that doesn't seem to be working as it did with the older CW7.1.  But I think my workaround is a bit more straightfoward and understandablle...at least to me.

 

I'm currently at a week long training event and will look to get Appnpte and other documentation generated to help others.

 

Hope this helps.

Regards,

David

PS

Trying to attach a ZIP that has the files I modified for my projects but if it doesn't show up its because I seem to had issues with getting attachments to load.

View solution in original post

0 Kudos
Reply
2 Replies
548 Views
DavidS
NXP Employee
NXP Employee

Hi Barber,

Good timing of question.  I've just helped someone else get this running with FSLMQX3.7 and M52259DEMO.

I found issue that I haven't found the root cause of yet but did find workaround to get the jump table working correctly.

I simple created a new "C" file to contain:

asm void jumptable(void);

extern unsigned long __boot;

    #pragma define_section jump_rom ".jumprom" far_absolute R
__declspec (jump_rom) asm void jumptable(void)
{
 nop
 jmp __boot 
}

 

Then added it to the application I want to load into FLASH.

 

The linker is updated with the following:

MEMORY
{
   jumprom     (RX): ORIGIN = 0x00004000, LENGTH = 0x00000010

...

 

KEEP_SECTION { .jumprom, .vectors_rom, .vectors_ram, .cfmconfig }

 

 .jumprom :
 {
        ___JUMP_ROM_START = .;  # Jump table
  jump_rom.c(.jumprom)
  . = ALIGN (0x4);
 } > jumprom

 

Lastly with the above changes you DO NOT need to have the following code used:

    #pragma define_section jump_rom ".jump_rom" far_absolute R
__declspec(jump_rom) const unsigned char _UserEntry[] @ USER_ENTRY_ADDRESS = {
  0x4E,
  0x71,
  0x4E,
  0xF9           //asm NOP(0x4E71), asm JMP(0x4EF9)          
};

__declspec(jump_rom) void  (* const _UserEntry2[])()@(USER_ENTRY_ADDRESS+4)=
{
  __boot,
};

 

 

This is the code snippet that doesn't seem to be working as it did with the older CW7.1.  But I think my workaround is a bit more straightfoward and understandablle...at least to me.

 

I'm currently at a week long training event and will look to get Appnpte and other documentation generated to help others.

 

Hope this helps.

Regards,

David

PS

Trying to attach a ZIP that has the files I modified for my projects but if it doesn't show up its because I seem to had issues with getting attachments to load.

0 Kudos
Reply
547 Views
barbercolman
Contributor III

Thanks. I will be trying shortly. BTW the zip was attached.

0 Kudos
Reply