cancel
Showing results for 
Search instead for 
Did you mean: 

Flash via NFC. (Logic question)

Vmere.1
Senior

Hello,

I want to update the MCU firmware using NFC.

I have a iphone and will create an app or use existing one, and st25dv dynamic tag which uses I2c to connect with stm32f411re.

And want to create a custom bootloader in flash similar to BL provided by stm32 which is in system memory.

0693W00000NsIHoQAN.pngThe following steps are the one which I perform.

  • I open the app and then select firmware upgrade.
  • Selecting the file to flash.
  • Click Start transfer and enter password.
  • press start transfer to start transmitting binary image.

Implementing logic in code:

Application is already running and I do the above steps, then the mcu will detect the nfc message and then will do soft reset (system reset), then bootloader starts running.

What should i do now to get the new firmware.?

I mean my question is, how can the MCU say, hey iPhone, im in bootloader please start sending the firmware now.

(I got this question because, i already pressed start transfer button in the iphone which made to swtich to bootloader code after system reset. What can i do to get the new firmware now? I know hal_flash, nfc transmit and receive functions lets say.)

my brain froze at this point.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi,

ST25DV supports only tag mode communication (doing load modulation and being able to decode reader-type modulation). There are devices like ST25R3916 which support all the required modes to be able to talk with another ST25R3916. In NFC Forum lingo these are called Universal NFC Devices.

BR, Ulysses

View solution in original post

4 REPLIES 4
Ulysses HERNIOSUS
ST Employee

Hi Vmere.1,

not 100% sure which problem you are trying to solve. I think you are concerned about the IPhone/App starting the upload procedure when your bootloader is not yet ready to receive the new image through NFC?! Please confirm or clarify.

If that is the case then I think you need to clearly define how this handover is to happen. Ideas here are:

  • Maybe the switch to bootloader is guaranteed to be fast enough. It will take quite some milliseconds to fill the mailbox. So you could just define that your bootloader just starts with an already filling mailbox in that use case.
  • If your switch is not fast enough you can consider some polling of the mailbox where the bootloader needs to provide a "I am ready" message. But unless the bootloader will reset the ST25DV I don't think this is necessary.
  • Likely you will also want a flag to let the bootloader know whether it should check for a valid program in flash and only await a binary if the flash does not contain a valid image or have it unconditionally wait for an image (in the case of firmware upgrade triggered by user).

Best Regards, Ulysses

Thanks for the answer,

I got little confused at the handshake, and my question is to be considered as more generic.

So a followup question. Not really related the above one.

Is there any possibility where two NFC dynamic tags communicate? (From the NFC stm32, i understood the communication between the reader and tag.

I want to remove the concept of debugger for flashing, i.e., lets say, I had a software and updated it to cloud platform, and some other person in another location had a NFC dynamic tag on the table which is sticked to table using sticker😅. And he has a stm32 mcu which is doing some work and also has a nfc dynamic tag. Can we now make a communication between two ST25dv tags to do the data transfer for flashing purposes?

Hi,

ST25DV supports only tag mode communication (doing load modulation and being able to decode reader-type modulation). There are devices like ST25R3916 which support all the required modes to be able to talk with another ST25R3916. In NFC Forum lingo these are called Universal NFC Devices.

BR, Ulysses

Thank you!!!