Secondary Bootloader not working for LPC54608J512BD208

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

Secondary Bootloader not working for LPC54608J512BD208

1,915 Views
prasannanaik
Contributor III

Hello,

I have referred "https://www.nxp.com/docs/en/application-note-software/AN12384SW.zip" for creating the secondary bootloader project and application note referrred was "https://www.nxp.com/docs/en/application-note/AN12384.pdf".

The secondary bootlaoder code in the zip file was for KEIL IDE, i have ported the code to MCUXpresso IDE. I have attached the secondary bootloader code in this message. I have used Flexcomm 1 for UART communication instead of Flexcomm 0 used in the zip file secondary bootloader code.

 

During loading of Application code given in zip file, using Tera Term software using YMODEM, my Tera Term software gets stuck at 9.1% and ends there after timeout as shown in image below.

Tera Term software problem reference application code.jpg

 

 

Also, while loading my Application code, the Tera Term software gets stuck at 0.3% as shown in image below

Tera Term problem custom application code.jpg

Please help in resolving this issue. 

 

Thanks & best regards,

Prasanna Naik

0 Kudos
10 Replies

1,875 Views
YaqiShang
NXP Employee
NXP Employee

Hi,
    My colleague has replied to your question.I also have downloaded your code and tested it successfully.Please remember to erase Flash before downloading the program every time.If you fail to run your application, please check teraterm and board.

 

BR
Yaqi Shang

0 Kudos

1,868 Views
prasannanaik
Contributor III

Hi Yaqi Shang,

I have commented the flash iap code from bootloader firmware to debug the firmware.

So in my code only uart communication and ymodem code is active.

I am trying to read the frames sent by the Tera Term software and the data sent by LPC546 to Tera Term software.

I have attached the sniffed serial data on both TX and Rx lines.

Can you please see the attached file and check if you find any clue what is going wrong?

 

Thanks & best regards,

Prasanna

0 Kudos

1,860 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi

Please confirm if the original Keil AN code can run correctly on your side? Can you get the same result as video shows? If original AN SW works well, you can compare it with our own project during debug. 

If original AN code can't work well. please resolve it first before your porting. 

Jun Zhang

 

0 Kudos

1,856 Views
prasannanaik
Contributor III

Hi ZhangJennie,

I have found the solution to the above problem.

I am using a different version of Tera Term software i.e. "TeraTerm-4.68", it is working now on the example application bin file. 

I had the doubt regarding the shifting of vector table in Custom application file.

The vector table in the application file must start from Sector 1 i.e address 32768 but how do i shift that in MCUXpresso IDE?

I have done the setting of Program Flash as shown in following image to start from address 32768 is that sufficient for IDE to shift the vector address?

 

 

Also, while sending my application code's bin file, the communication gives an error at 74.3% i.e when 262144 bytes of data has been transferred. What could be the problem?  Error code (-3) is returned by modem_recvdata() function.

 

Thanks & best regards,

Praasanna

0 Kudos

1,848 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Seems you asked a new question on vector relocation.

vector relocation is necessary for secondary bootloader.

I suggest you referring this thread

https://community.nxp.com/t5/MCUXpresso-IDE/How-to-relocate-interrupt-vector-table-in-MCUXpresso/m-p...

BTW, if you have new question, please create a new thread. Thanks for your cooperation.

 

Have a nice day,

Jun Zhang

0 Kudos

1,846 Views
prasannanaik
Contributor III

Dear ZhangJennie,

I have not been able to upload my application file yet as mentioned in the last part of my previous reply.

As per my observation, communication stops when the packet number 256 is being transferred. As per YMODEM frame format, one byte is used to represent the frame number which can maximum store value upto 255. Does this mean that maximum size that can be transferred through YMODEM protocol is 256 frames i.e 256 KB.

Have you tried sending File size greater than 256KB?

My Application File (.bin File) size is 353KB

Can you try loading a file size greater than 300KB and confirm if it works?

 

Thanks & best regards,

Prasanna

0 Kudos

1,820 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Can you reproduce the issue with original AN SW? if yes, send your application bin file. We will check.

0 Kudos

1,817 Views
prasannanaik
Contributor III

Hi ZhangJennie,

The application bin file shared in Application note project folder are of very small size i.e. 11KB (It works fine)

My application bin file size is more than 300KB

Due to privacy concerns, i can't share my custom application bin file in the open forum. I have shared my custom aplication bin file in the NXP Ticket number "support case: #00353652". You can take it from there and try on your end.

Thanks & best regards,

Prasanna

0 Kudos

1,815 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

OK, this case is handled by my colleague. we will check it.

0 Kudos

1,906 Views
prasannanaik
Contributor III

On Further debugging, i found that

1) Following code snippet is getting error response:

errIAP = IAP_Compare(
gAppFwWriteCurAddr, /* dstaddr. */
(uint32_t *)(gAppModemStruct.buf), /* srcAddr. */
MODEM_PACKAGE_BYTE_COUNT /* numOfBytes. */
);
if (errIAP != kStatus_IAP_Success)
{
err = 10;
}

 

in hello_world.c file

2) errIAP value is 10210 which is kStatus_IAP_CompareError.

Why IAP is not able to write?

 

Thanks & best regards,

Prasanna

0 Kudos