cancel
Showing results for 
Search instead for 
Did you mean: 

How to flash code into The B-L072Z-LRWAN1 Discovery kit

PAmey.3
Associate II

Hello,

I am very very new with STM32 and I am doing a challenge. I am working on a Macbook Air

​

I have at my disposal a

The B-L072Z-LRWAN1 Discovery kit

A st-link

A j-link

​

My goal is to build a Gateway-repeater with BL072Z-LRWAN decovery kit, with the following instruction

​

For this, I already completed some steps successfuly (with help), but we did do not find how to flash the code into my BL072Z-LRWAN discovery kit.

​

Here are the steps

​

  1. We dowloaded this (for Mac) to ~/Download
  2. I dowloaded this and copy the files to /usr/local/gcc_arm
  3. I edited ~/.profile and added the line
  4. export PATH=$PATH:/usr/local/gcc_arm/gcc-arm-none-eabi-8-2018-q4/bin
  5. I cd ~/Download/LoRaWanRelay-master
  6. I lunched Make from ~/Download/LoRaWanRelay-master
  7. All went fine.

After the Make I got a new folder named ~/Download/LoRaWanRelay-master/build with a lot of different files, with some extention like .lst and .o and .d

​

Now, I have to connect my discovery code and flush the code into the board and unfortunately, I

The Make file is big but I past the cod here as a text file here

A colleague suggested me to add this

 
    #######################################
    flash the chip
 
    #######################################
    flash:
    openocd -d0 -f stm32f3.cfg -c “init;reset halt;stm32f3x mass_erase 0;flash write_image build/oibus-mini-mikrobus-stm32-firmware.hex;reset run;shutdown�?

Nut we could not test and it would be great to have you point of and advices

​

Would it be possible to have some. instruction?

Many, many thank for your help!

Cheers

Pierrot

​

6 REPLIES 6
PAmey.3
Associate II

It seam I need to use this0690X000008jC0HQAU.jpg

but how to connect, and how to flash ? :smirking_face:

and it look to have an micro usb connectot with the text "USB STLINK". May it be integrated?

PAmey.3
Associate II

I observed an interresting things. I connected the USB cable to the microUSB connector of the B-L072Z-LRWAN1 discovery kit

It was like a USB stick, it maped the board and I can see two files

  1. DETAILS.TXT
  2. MBED.HTM

The flashing process would be to simply copy/past files?

The Discovery board has a built-in ST-LINK, so the external one is not required.

The mbed drive should accept a firmware binary in the form FW.BIN, in Windows a drag-n-drop operation, or COPY from the console.

It will not accept .HEX or .ELF files, so those would need to be converted with objcopy (as I recall)

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Dear Clive,

Thank a lot for your reply!!!

Then If I understand, after I ran the command

make clean all

a folder named 'build' is created. In that folder there is a lot of files witht he extension .o, .lst, .d, but I just observed 4 files:

MiniMouse.bin       

MiniMouse.elf         

MiniMouse.hex 

MiniMouse.map

What's .map, .elf and .hex ?

Then as you write, I should simply copy the bin file to my discovery kit board? ( when i connect my USB cable, my Macbook Air mount a drive, as a USB stick.

Then unmount it, add the battery, and the board works???

(I may have a other question, if above is correct)

The .MAP file is a ASCII, nee human-readable, report from the linker about symbols, names, and locations.

The .ELF is the primary output of the linker, it is an Object File Format, containing your binary code/data, and a lot of metadata about locations and symbols, etc.

The .HEX file is an ASCII representation of the code/data in memory, it provides address information, can be sparse (have holes, and describe multiple regions of memory), is verbose (about 2.5x larger than necessary) and is in a form that can be emailed.

The .BIN file is a binary (byte for byte) representation of code/data in memory, these are the values written into the memory and read and processed by the MCU. The address is assumed to be the base of flash, and is a linear/continuous image of memory

You should be able copy the MiniMouse.bin file to the mbed faux drive

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Thank a lot Clive.

I am going to test that tomorrow or Tuesday.

I have another question but I will open a new post

Cheers

Pierre