Linux STM32F103VB Programming

I had bought the jlink (clone) from the aliexpress and was unable to use it program the my STM3210B-LK1 Development board. After lot of googling and i was finally able to unlock my jlink debugger and was able to program the stm32f103vb device with blink led example.

Step 1 – Hardware Setup Required

  1. STM3210B-LK1 Development Board – STM3210B-LK1 Usermanual
  2. JLINK Debugger – Lazada – Jlink Debugger
  3. PC – Linux Mint 18.3 Sylvia

Step 2 – Software

  1. Jlink Debugger – 6.12a Version – Higher version doesnt allow you to unlock the jlink clone
  2. Sam-ba_2.16 version(i had used the windows machine to unlock)
  3. V8_Firmware_NoSerial_crackn – Firmware required for unlocking Jlink
  4. STM32F103VHB6_RevZ_Demo1_Lanchon_20080210.zip – simple LED Blink Program
  5. Software can be found in this github repository – Jlink_Unlock_Sw

Unlocking Jlink Debugger

These 2 links have helped a lot for me to understand the procedure and unlock the jlink debugger

  1. http://www.sonsivri.to/forum/index.php?topic=41726.50
  2. https://gronlier.fr/blog/2015/07/unbrick-and-update-an-j-link-v8-clone/
  3. Only thing that i would highlight is after TST Pin Step, Bossa Program Port driver is automatically downloaded from the internet.
  4. To enable the AT91 USB to serial adapter disable the network connection and uninstall the bossa Program port driver and install the atmel driver from SAM-BA “drv” folder
  5. And also ensure you are using Jlink version 6.12A, as 6.22 version was disabling my jlink, even after i had unlocked it

Building and Programming the main.bin

  1. make

Led_Blink_Build

2. Connect to STM32F103 Device using Jlink

Jlink_programming

Hurray after 6 hours of struggle i was finally able to program my device. My next thing is to program the OpenBLT Bootloader and program the application software using Boot Commander Utility

Update 11-Dec-2017

  1. Launch the JLinkGDBServer -device STM32F103VB -if SWD
  2. use the arm-none-eabi-gdb to debug your program
    1. target remote lochalhost:2331
    2. connect
    3. mon reset
    4. load “elf file”
    5. mon go –> for full run
    6. step 1 –> single stepping
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s