cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103C8 Remotely programming flash memory(bootloader firmware update) over GSM(GPRS module)(C++,C)

pm_brk_pm
Associate II
Posted on August 05, 2016 at 09:50

Hello everyone,

I would like to inform you that  I'm new in ARM CPU usage and programming.I was working at one specific automation project in my job and they assigned me to remote monitoring device after finishing this project.

This device includes includes;

1)GPRS module(Telit_GL865) via (USART2)

2)GPS module (Ublox_Max_M8Q) via (USART3)

3)32 bit arm cpu(STM32F103C8)

They already prepared this project and it sends data recieved from GPS over GPRS module to our server.Thus we are able to track where the vehicle is.

In this case, They want to add a new future to this device.This is , remotely programmable device.

But Unfortunately, I have no idea how to add this new future to device.Also I would like to inform you that, there is an external eeprom device which will be communicated via I2C for flashing program.

So, According to my research(Could you please confirm);

1)I started to investigate about how to host c programming file on the server.Most of developers have made it by loading the program file in the server as .hex file(Is it correct or proper solution ?)

2)How can i download .hex file by using GPRS module(there are bunch of ''AT'' commands).Should ? connect to server and open file by c commands and read char values one by one? or Is it possible to download and send it to external EEPROM.What should I search about this condition?

 3)After handling these issues(1. and 2.), how can i take the file from eeprom or transfer to flash memory and loading it using bootloader method.

I need some example codes, ideas and working principle of flash memory, eeprom and arm (registers,interrupts,initiation structure)

I know, I want too much but I have to handle this.

Any kind of help will be greatly appreciated.

Thank you.

#worst-forum-software-ever #telit
3 REPLIES 3
Posted on August 05, 2016 at 17:40

I wrote a long response to this that the forum just ate with a 404 error....

I might come back to it later.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on August 06, 2016 at 01:31

I did this using an HTTP GET implementation using the AT commands to open a socket connection to the server. If you have previous experience using Berkeley Sockets or WINSOCK, these techniques would be applicable here.

A binary file with some sort of integrity checking would be preferable to the .HEX files, which would be around 2.5x larger and the equivalent .BIN.

The STM32 examples include several implementing IAP (In Application Programming), these could be modified to pull data staged on an I2C EEPROM

Elecia White's book has a chapter on boot-loaders.

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

I use the HTTPQRY and HTTPRCV commands with the Telit DE910,  a GET with flow control.  If your Telit doesn't support HTTP commands (not all do) take a look at the FTP commands.  The problem with FTP is no software flow control.  FTP might work if you have RTS/CTS hardware flow control at the USART.

With a DE910 I can download 192KB binary (about 500KB hex file) and copy to flash on an 'L152 in about 5 minutes.  I suggest you use the hex file format even though it's much larger, since you get a checksum per text line.  You get an early warning if a message is dropped (it's TCP/IP, a drop can occur on the server network before it even gets to the radio gateway).  As Clive points out, with a BIN you have to load the entire image then checksum it for integrity at the end.

FYI on the DE series there has to be a delay between GETs, not well documented in the manual.  About 50ms seems to work reliably.  The symptom is the modem will hang on a GET and never recover without a hard reset.

  Jack Peacock