FNET Bootloader with MQX

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

FNET Bootloader with MQX

Jump to solution
1,685 Views
master_szumi
Contributor III

I'm using FNET bootloader - when I download project without MQX (f.e.: "Hello world!") from .srec file everything works ok - after "go" command program starts.

 

But when I download project with MQX after "go" command program stops and do nothing!

 

Any suggestions?

0 Kudos
1 Solution
883 Views
master_szumi
Contributor III

Response from Alejandro (Freescale support):

 

Finally we found the problem but unfortunately the only way to solve this issue is with a hotfix. This is not the best solution indeed this hotfix is only for IAR and MQX. By default, IAR compiler sets the entry point to enter in some configuration routines which makes MQX applications fail. To be honest we do not know the reason, but I contacted IAR to provide an explanation to this behavior. Meantime you can implement the hotfix by hard coding the entry point. Please refer to line 588 in fapp_tftp.c from the Ethernet bootloader:

 

/* Set entry point. */

fapp_params_boot_config.go_address = 0x0000C411; //(unsigned long)addr;

fnet_shell_println(desc, FAPP_TFTP_ENTRYPOINT_STR, addr);

 

 

 

View solution in original post

0 Kudos
8 Replies
883 Views
DavidS
NXP Employee
NXP Employee

Hi Master_szumi,

Take a look at FNET to see what resources it is using (interrupt wise).  Usually when jumping from a bootloader to an application the application needs to make sure the system has a clean start.  Likewise the FNET could be updated to make sure it is cleaning the system too.

Hope this helps.

Regards,

David

0 Kudos
883 Views
master_szumi
Contributor III

Ive noticed that program waits on address 0xdf274

 

on:

 

BVS 0x7ac44

 

where is (from map file)

 

_pend_svc               0x0000d23b         Code  Gb  dispatch.o [7]

 

Any ideas?

0 Kudos
883 Views
DavidS
NXP Employee
NXP Employee

No idea with that info.

I'd try to get application to run from downloading with debugger and not use the FNET bootloader to take it out of the equation for debugging purposes. 

If it runs without FNET, then something that is setup by FNET is affecting the MQX application.

If it is not running with FNET then need to debug the application.

Regards,

David

0 Kudos
884 Views
master_szumi
Contributor III

Response from Alejandro (Freescale support):

 

Finally we found the problem but unfortunately the only way to solve this issue is with a hotfix. This is not the best solution indeed this hotfix is only for IAR and MQX. By default, IAR compiler sets the entry point to enter in some configuration routines which makes MQX applications fail. To be honest we do not know the reason, but I contacted IAR to provide an explanation to this behavior. Meantime you can implement the hotfix by hard coding the entry point. Please refer to line 588 in fapp_tftp.c from the Ethernet bootloader:

 

/* Set entry point. */

fapp_params_boot_config.go_address = 0x0000C411; //(unsigned long)addr;

fnet_shell_println(desc, FAPP_TFTP_ENTRYPOINT_STR, addr);

 

 

 

0 Kudos
883 Views
butok
NXP Employee
NXP Employee

Hi Szumi,

 

Srec-file generated by IAR ARM has wrong entry point (BTW: the IAR for MCF is correct).

There is workaround, without modification of the bootloader sources code.

So you may manually modify one line with entry point, in SREC file.

OR You may try to override default entry point in IAR ARM IDE:

  1. Choose FLASH target.
  2. Menu [Project]->[Options…]->[Linker]->Check in “override default program entry” and enter correct “Entry symbol”.

This workaround is part of the FNET shell_boot demo project for IAR ARM (just in case).

 

Thank you,

Andrey Butok

0 Kudos
883 Views
master_szumi
Contributor III

I prefer to use raw bin file instead of srec file (becouse of size and download time).

 

So I set fixed value of entry point to 0xC411 (in FNET configuration file - "go" command) and I hope it will be work.

 

 

 

 

0 Kudos
883 Views
Skyhawk
Contributor I

Two questions: When I enable TFTP client.

 

#define FNET_CFG_TFTP_CLN (1)

 

I get 

Error[Li005]: no definition for "fapp_params_boot_config" [referenced from bootloader\fnet_demos\mk60n512\shell\iararm6.1\FLASH_512KB_PFLASH\Obj\fapp.o]

 

when compilng the 'shell' demo application.

Also, why is the hardcoded address '0xC411' ? I would expect 0xC410 since the default adress is 0x410 and the bootloader consumes the first 48kb (so add 0xC000)

 

Greetings,

 

Jan 

 

0 Kudos
883 Views
Skyhawk
Contributor I

Excuse me, I was wrong, the problem occurs only after define FAPP_CFG_TFTP_CMD     (1) 

is added also.

 

When I add:

 

 #define FAPP_CFG_PARAMS_BOOT  (1)

 

The problems is solved.

0 Kudos