cancel
Showing results for 
Search instead for 
Did you mean: 

IAP_UART

bhavesh
Associate II
Posted on April 02, 2016 at 12:57

HI,

i facing a problem with UART / IAP, 

i want to download file(.BIN or .HEX) in to FLASH by using UART only.

i check example project from ST but i won't YMODEM, i just wan't to send file using terminal(TERA-TERM) and store it in flash.

How can i do this please help.

#uart-/-iap #uart-/-iap #flash. #iap #uart
9 REPLIES 9
pkumar1883
Associate II
Posted on April 02, 2016 at 13:32

Dear moradiya.bhavesh,

Why do not use Hyperterminal. It has inbuilt Ymodem file sending utility.

If you do not want to use Ymodem, then you will have to write your own FTP.  

/*Please

 mark helpfull

 if this post helps you or solves your problem.*/

/* If you need any personal support for your work please contact at 

embeddeddesign.help@gmail.com*/

Posted on April 02, 2016 at 15:15

One of the problems writting flash is that it is vey slow and stalls the processor. You need some protocol that has inherent flow control.

For .hex files you might want to parse a line at a time decoding and writing the data described

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
bhavesh
Associate II
Posted on April 06, 2016 at 09:25

HI,

Thanks for suggestion,

I check example project available on ST site and it's work fine, but problem is in that -   ''Y' MODEM'' is used But, I want to use only serial communication (Example: File''.Hex/ .Bin'' will be download from server through GPRS (M95 GPRS modem used)). I have used simple UART receive function to receive .Hex / .Bin file byte by byte. can you suggest how to implement ''Y-MODEM protocol'' with the help of M95 GPRS.

bhavesh
Associate II
Posted on April 06, 2016 at 10:08

Hi, Clive1

Here is a attachment in which you can see I am able to receive complete new file from the terminal with no error. I have received .bin file of 28 kb

(size on HDD)

That means in a single controller there will be two file when OTA update function is called.

Now the problem is the delay, i.e. delay of 30 ms to send one byte from the hyper-terminal is the constraint if I decrease the delay of the hyperterminal to send one byte then error will occur during loading a file into the flash memory.So can you suggest some other way to load new file into the flash memory of STM32?

Right now loading a new file using OTA update is taking time of approx 18 min. for 28KB of .bin file

only serialcommunicationis used here and if file size is lower than ~10 KB I able to download without any delay and its work fine. and also it execute also.

I cross check decrease delay in Hyper Terminal it lowest point is 2 ms but it won't be 0 ms it depend on file size(Example: if i send 6 KB file no delay require at Hyper-Terminal).

Note: Delay is notperformin STM32 Program we are putting delay from the Terminal side to transfer file Byte by Byte

________________

Attachments :

Dev_vd_Bin.png : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I188&d=%2Fa%2F0X0000000bip%2FXfHRX6AapSgl7YLM3IuWvO9vrScP__ZRobQJexFwSZU&asPdf=false
Posted on April 06, 2016 at 14:35

Not really illustrative of the failure condition.

Are you erasing the sectors as you go?

I think you need some flow-control, so you can manage the write/erase of flash

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Walid FTITI_O
Senior II
Posted on April 06, 2016 at 18:12

Hi moradiya.bhavesh,

Thhe IAP using USART embedded software 

http://www.st.com/web/en/catalog/tools/PF262163

takes the Tera Term emulator as example. You find related information in the relevant Application note

http://www.st.com/st-web-ui/static/active/en/resource/technical/document/application_note/DM00161366.pdf

; under ''2.1 Tera Term configuration'' part.

-Hannibal-

Posted on April 06, 2016 at 19:10

I think the desire here is to send the firmware as a continuous stream of bytes. I don't think that's is entirely practical on a raw serial channel, but would work at a higher level, like via HTTP, where the transfer protocol is handled in the background.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
bhavesh
Associate II
Posted on April 07, 2016 at 11:16

Hi, Clive1 & kk

Thank you for your time,

Thanks to help solving my problem and now, I able to download .bin file byte by byte using hyper terminal without any delay.

bhavesh
Associate II
Posted on April 07, 2016 at 11:32

Hi, Hannibal

Thanks for file, I will have look at it.