NHS31xx NFC Program Loader App - Download Error during flashing

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

NHS31xx NFC Program Loader App - Download Error during flashing

Jump to solution
7,225 Views
Nobby
Contributor II

Hello, 

I'm tring to use the App NHS31xx NFC Program Loader,

I turned on the NFC on my smartphone,

I selected the basic blink program for testing the App.

And I got the following error: 

Download error. Remove the Tag from the NFC field and try again on my smartphone

I did the test with two exact NHS3152

Thank you in advance for your help

0 Kudos
Reply
1 Solution
7,127 Views
patrickgeens
NXP Apps Support
NXP Apps Support

Hi Nobby,

 

Correct, if JP2 is set and the LPCLINK2 is connected via SWD, there is no need for a (charged) battery.

In that case, I recommend to remove the battery, this makes it easy to power cycle the NHS by temporary disconnecting the USB cable from the LPCLINK2.

 

if JP2 is mounted on the LPCLINK2 and the NHS board is connected via the SWD cable (as can be seen in the photograph you attached), the NHS chip is powered from the LPCLINK2 supply via pin 1 of the SWD connector because the battery voltage is typically lower than 3.0V. If the LPCLINK2 is disconnected from USB, the NHS board battery will take over as both battery and LPCLINK supplies are coupled via diodes to VDDBAT.

If JP2 is not mounted, a battery must be used and the LPCLINK2 will use the VDDBAT voltage on pin 1 of the SWD connector to feed its level translating buffers.

 

patrickgeens_0-1675954179414.png

 

 

Kind regards,

Patrick

View solution in original post

10 Replies
7,108 Views
Nobby
Contributor II

 Hi Patrick,

Finnaly it works

Thank very much for the help 

Kind regards,

Nobby

0 Kudos
Reply
7,152 Views
Nobby
Contributor II

Hi Patrick,

Thanks for the response.

I also notice the JP2 from the figure you sent.

But I do not understand when you mentioned that:

"use LPC-LINK2 with JP set to power the NHS chip via the SWD cable."

I use LPC-Link2 to power the chip. And the LPC-Link2 is link to the chip via a SWD cable (see attached file).

I supposed when the chip is connected to the PC via the LPC-LINK2 and the SWD calble, then the battery is not needed to be charged?

Also, even if the chip is connected to the PC via the LPC-LINK2 and the SWD calble, do I still need to use the JP2?

More precisely, how do I use the JP2?

Thank you

Best regards,

Nobby

0 Kudos
Reply
7,128 Views
patrickgeens
NXP Apps Support
NXP Apps Support

Hi Nobby,

 

Correct, if JP2 is set and the LPCLINK2 is connected via SWD, there is no need for a (charged) battery.

In that case, I recommend to remove the battery, this makes it easy to power cycle the NHS by temporary disconnecting the USB cable from the LPCLINK2.

 

if JP2 is mounted on the LPCLINK2 and the NHS board is connected via the SWD cable (as can be seen in the photograph you attached), the NHS chip is powered from the LPCLINK2 supply via pin 1 of the SWD connector because the battery voltage is typically lower than 3.0V. If the LPCLINK2 is disconnected from USB, the NHS board battery will take over as both battery and LPCLINK supplies are coupled via diodes to VDDBAT.

If JP2 is not mounted, a battery must be used and the LPCLINK2 will use the VDDBAT voltage on pin 1 of the SWD connector to feed its level translating buffers.

 

patrickgeens_0-1675954179414.png

 

 

Kind regards,

Patrick

7,175 Views
Nobby
Contributor II

Hi Patrick,

Thank you for the clear instructions,

After flashing, the application Program Loader can start now,

But I received the following message:

"Download completed. However the last confirmation was missed. Please check if the new firmware is now running on your NHS31XX IC".

The program I tested was the blink. And at the end, the firmware did not blink.

Note: I already tested the blink program via the USB cable, and it works.

Another question, is it risky to flash the firmware several times?

Kind regards,

Nobby

0 Kudos
Reply
7,172 Views
patrickgeens
NXP Apps Support
NXP Apps Support

Hi Nobby,

 

This error is caused by insufficient power via VDDBAT, typically a drained battery or no battery, during NFC program loading.

At the end of the program loading a flash erase cycle is done to overwrite the first sector, which fails due to insufficient power from a drained battery, or in case of no battery, from NFC power only. The chip then resets and does not send back the confirmation packet. In most cases the first sector is erased and the chip does not run any firmware after reset or power cycle.

You can fix this by flashing nfcprogramloader or any other firmware via SWD.

In case of doubt, use LPC-LINK2 with JP set to power the NHS chip via the SWD cable.

patrickgeens_0-1675866422145.png

 

Kind regards,

Patrick

0 Kudos
Reply
7,181 Views
Nobby
Contributor II

Hi Patrick,

Thank you for the reply.

I just realized that flashing via NFC can only be done one time a few minutes before your answer.

The instruction is clear, but how to flash using the SWD cable? If I only have the hex file and the bin file?

Kind regards,

Nobby

0 Kudos
Reply
7,178 Views
patrickgeens
NXP Apps Support
NXP Apps Support

Hi Nobby,

 

You can use Flash Magic for this:

https://www.flashmagictool.com/download.html&d=13.50/FlashMagic.exe

 

In Flash Magic: select the correct NHS device from the device database

patrickgeens_0-1675861176930.png

 

Select the hex file, check "Verify" and "Go after programming" (otherwise the processor remains halted)

Press "Start" to flash.

patrickgeens_3-1675861857164.png

 

Kind regards,

Patrick

 

 

 

 

 

7,197 Views
Nobby
Contributor II

Hello Patrick,

Thank you for the response.

I'm not sure if the download has started.

But I tested the android application with two options: (1) connected the chip to the LPCLINK2, (2) disconnected using the battery

And for both options, I got the same error: "Download error. Remove the Tag from the NFC field and try again on my smartphone".

I also tested with another android smartphone, but I still get the same error.

Something I didn't mention in the original post is that the smartphone continuously displays the last message inside the TAG.

I don't know if there is a sender/receiver mode for the smartphone and the chip?

Another last question, since the error message asks me to remove the TAG from the NFC field, maybe a solution is to delete the information inside the TAG? If this is the solution, how to erase the value inside the Tag?

Kind regards,

Nobby

0 Kudos
Reply
7,186 Views
patrickgeens
NXP Apps Support
NXP Apps Support

Hi Nobby,

 

The NFC program loader app communicates with a specific firmware ("nfcprogramloader") in the NHS chip, flashed into memory when the chips leave the factory.

When another firmware is flashed by the NFC program loader app or via SWD,  nfcprogramloader is overwritten and NFC flashing functionality is lost. So NFC programming is a one-time thing.

For testing purposes the NFC program loading firmware can be restored by flashing "app_closed_nfcprogramloader.hex" from the SDK package via the SWD cable.

patrickgeens_2-1675856064386.png

 

When nfcprogramloader is running, it writes a short NDEF message in the NFC memory which shows a  "n/p" text message when tapped. See screenshot below.

Can you check if this message is present? If not, you need to restore the nfcprogramloader via SWD.

patrickgeens_0-1675855436165.png

 

A handy tool to see what is in the NFC memory is the NXP TagInfo app.

https://play.google.com/store/apps/details?id=com.nxp.taginfolite&hl=nl&gl=US

patrickgeens_1-1675855538822.png

 

Kind regards,

Patrick

 

7,202 Views
patrickgeens
NXP Apps Support
NXP Apps Support

Hello Nobby,

 

If the error appears after part of the program has been downloaded to the NHS chip, it is an indication of insufficient VDDBAT power: typically no battery or a depleted battery.

Replace the battery by a fresh one. If you have a lab supply or an LPCLINK2, you can use those to power the NHS chip.

Setting jumper JP2 on the LPCLINK2 drives a USB derived 3.3V via pin 1 of the SWD connector to VDDBAT. In case of a depleted battery: remove it even if using an external supply, as it will prevent a full power cycle of the chip.

 

Kind regards,

Patrick

0 Kudos
Reply