[ell-i-developers] Re: changes in stlink to get our nucleo flashed in ubuntu

  • From: Eero Hakala <eero.k.hakala@xxxxxxxxx>
  • To: ell-i-developers <ell-i-developers@xxxxxxxxxxxxx>
  • Date: Mon, 8 Sep 2014 21:51:14 +0300

Jep, its OK för me
8.9.2014 19.18 kirjoitti "Lari Lehtomäki" <lari@xxxxxxxxxxxx>:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hello,
>
> I tested to code and it worked like expected. Couple size and base
> address definions where incorrect and I searched correct values for
> them from STM32F334 reference manual (RM0364). The attachemnt contains
> all the changes in one patch.
>
> Is it Eero ok if I send the patch to texane to be included in official
> version?
>
> - -Lari
>
> On 02.09.2014 09:13, Eero Hakala wrote:
> > Hi, I made some changes in stlink to get our nucleo flashed -
> > could somebody please review this because I have not been able to
> > figure out all details (they are well hidden in st-pages).
> >
> >
> > This is the general process of setting up the environment:
> > git@xxxxxxxxxx:texane/stlink.git
> >
> > then in stlink directory ./autogen ./configure make
> >
> > And voila, all ready: st-util and st-flash look like functional -
> > some probelms still with st-info and st-term...
> >
> >
> > Changes to be revied are in src/stlink-common.c and
> > src/stlink-common.h:
> >
> > This is what diff gives out eero@tkone:~/swe/sula$ diff
> > stori/src/stlink-common.h stlink/src/stlink-common.h 128a129
> >> #define STM32_CHIPID_F334           0x438
> > 326a328,338
> >> .bootrom_base = 0x1ffff000, .bootrom_size = 0x800 }, { // This is
> >> STK32F334R8 device from STM32 nucleo board // Support based on
> >> 303 above (37x and 30x have same
> > memory map)
> >> .chip_id = STM32_CHIPID_F334, .description = "ähväkolomonen
> >> device", .flash_size_reg = 0x1ffff7cc, .flash_pagesize = 0x800,
> >> .sram_size = 0x4000,
> >
> > But its in fact wrong because I just added an elemnt in the data
> > structure, not something in between as diff thinks, the change is
> > just an addition as below: addition from 331 to 341 { // This is
> > STK32F334R8 device from STM32 nucleo board // Support based on 303
> > above (37x and 30x have same memory map) .chip_id =
> > STM32_CHIPID_F334, .description = "ähväkolomonen device",
> > .flash_size_reg = 0x1ffff7cc, .flash_pagesize = 0x800, .sram_size =
> > 0x4000, .bootrom_base = 0x1ffff000, .bootrom_size = 0x800 },
> >
> > Then I just added the missing chip info to the most suitable place
> > every time that st-flash complained something! As I don't know all
> > differences these additions might be in a wrong place!
> >
> > eero@tkone:~/swe/sula$ diff stori/src/stlink-common.c
> > stlink/src/stlink-common.c 1130c1130,1131 <             ||
> > sl->chip_id == STM32_CHIPID_F37x) { ---
> >> || sl->chip_id == STM32_CHIPID_F37x || sl->chip_id ==
> >> STM32_CHIPID_F334) {
> > 1361c1362 <     } else if (sl->core_id == STM32VL_CORE_ID ||
> > sl->chip_id == STM32_CHIPID_F3  || sl->chip_id ==
> > STM32_CHIPID_F37x) { ---
> >> } else if (sl->core_id == STM32VL_CORE_ID || sl->chip_id ==
> > STM32_CHIPID_F3  || sl->chip_id == STM32_CHIPID_F37x || sl->chip_id
> > == STM32_CHIPID_F334) { 1658c1659 <     } else if (sl->core_id ==
> > STM32VL_CORE_ID || sl->core_id == STM32F0_CORE_ID || sl->chip_id ==
> > STM32_CHIPID_F3  || sl->chip_id == STM32_CHIPID_F37x) { ---
> >> } else if (sl->core_id == STM32VL_CORE_ID || sl->core_id ==
> > STM32F0_CORE_ID || sl->chip_id == STM32_CHIPID_F3  || sl->chip_id
> > == STM32_CHIPID_F37x || sl->chip_id == STM32_CHIPID_F334) {
> > 1762c1763 <     } else if (sl->core_id == STM32VL_CORE_ID ||
> > sl->core_id == STM32F0_CORE_ID || sl->chip_id == STM32_CHIPID_F3
> > || sl->chip_id == STM32_CHIPID_F37x) { ---
> >> } else if (sl->core_id == STM32VL_CORE_ID || sl->core_id ==
> > STM32F0_CORE_ID || sl->chip_id == STM32_CHIPID_F3  || sl->chip_id
> > == STM32_CHIPID_F37x || sl->chip_id == STM32_CHIPID_F334) {
> > 1794c1795 < #define WAIT_ROUNDS 10000 ---
> >> #define WAIT_ROUNDS 100000
> > 1821c1822 <     } else if (sl->core_id == STM32VL_CORE_ID ||
> > sl->core_id == STM32F0_CORE_ID || sl->chip_id == STM32_CHIPID_F3
> > || sl->chip_id == STM32_CHIPID_F37x) { ---
> >> } else if (sl->core_id == STM32VL_CORE_ID || sl->core_id ==
> > STM32F0_CORE_ID || sl->chip_id == STM32_CHIPID_F3  || sl->chip_id
> > == STM32_CHIPID_F37x || sl->chip_id == STM32_CHIPID_F334) {
> >
> >
> > -eero-
> >
> > PS find below output from st-util and st-link
> >
> >
> > ./st-flash write
> >
> /home/eero/swe/RIOT/examples/hello-world/bin/stm32f3discovery/hello-world.hex
> >
> >
> 0x08000000
> > 2014-09-02T08:44:17 INFO src/stlink-common.c: Loading device
> > parameters.... 2014-09-02T08:44:17 INFO src/stlink-common.c: Device
> > connected is: ähväkolomonen device, id 0x10016438
> > 2014-09-02T08:44:17 INFO src/stlink-common.c: SRAM size: 0x4000
> > bytes (16 KiB), Flash: 0x10000 bytes (64 KiB) in pages of 2048
> > bytes 2014-09-02T08:44:17 INFO src/stlink-common.c: Attempting to
> > write 36044 (0x8ccc) bytes to stm32 address: 134217728 (0x8000000)
> > Flash page at addr: 0x08008800 erased 2014-09-02T08:44:17 INFO
> > src/stlink-common.c: Finished erasing 18 pages of 2048 (0x800)
> > bytes 2014-09-02T08:44:17 INFO src/stlink-common.c: Starting Flash
> > write for VL/F0 core id 2014-09-02T08:44:17 INFO
> > src/stlink-common.c: Successfully loaded flash loader in sram 17/17
> > pages written 2014-09-02T08:44:19 INFO src/stlink-common.c:
> > Starting verification of write complete 2014-09-02T08:44:20 INFO
> > src/stlink-common.c: Flash written and verified! jolly good!
> >
> > eero@tkone:~/swe/sula/stlink$ ./st-util -v99 2014-09-02T08:45:09
> > DEBUG src/stlink-common.c: stlink current mode: debug (jtag or
> > swd) 2014-09-02T08:45:09 DEBUG src/stlink-common.c: stlink current
> > mode: debug (jtag or swd) 2014-09-02T08:45:09 INFO
> > src/stlink-common.c: Loading device parameters....
> > 2014-09-02T08:45:09 DEBUG src/stlink-common.c: *** stlink_core_id
> > *** 2014-09-02T08:45:09 DEBUG src/stlink-common.c: core_id =
> > 0x2ba01477 2014-09-02T08:45:09 DEBUG src/stlink-common.c: ***
> > stlink_read_debug32 10016438 is 0xe0042000 2014-09-02T08:45:09
> > DEBUG src/stlink-common.c: *** stlink_read_debug32 ffff0040 is
> > 0x1ffff7cc 2014-09-02T08:45:09 INFO src/stlink-common.c: Device
> > connected is: ähväkolomonen device, id 0x10016438
> > 2014-09-02T08:45:09 INFO src/stlink-common.c: SRAM size: 0x4000
> > bytes (16 KiB), Flash: 0x10000 bytes (64 KiB) in pages of 2048
> > bytes 2014-09-02T08:45:09 DEBUG src/stlink-common.c: *** looking up
> > stlink version 2014-09-02T08:45:09 DEBUG src/stlink-common.c: st
> > vid         = 0x0483 (expect 0x0483) 2014-09-02T08:45:09 DEBUG
> > src/stlink-common.c: stlink pid     = 0x374b 2014-09-02T08:45:09
> > DEBUG src/stlink-common.c: stlink version = 0x2 2014-09-02T08:45:09
> > DEBUG src/stlink-common.c: jtag version   = 0x14
> > 2014-09-02T08:45:09 DEBUG src/stlink-common.c: swim version   =
> > 0x4 2014-09-02T08:45:09 DEBUG src/stlink-common.c: *** stlink_reset
> > *** 2014-09-02T08:45:09 INFO gdbserver/gdb-server.c: Chip ID is
> > 00000438, Core ID is  2ba01477. 2014-09-02T08:45:09 DEBUG
> > src/stlink-common.c: *** reading target voltage 2014-09-02T08:45:09
> > DEBUG src/stlink-common.c: target voltage = 3232mV
> > 2014-09-02T08:45:09 INFO gdbserver/gdb-server.c: Target voltage is
> > 3232 mV. 2014-09-02T08:45:09 INFO gdbserver/gdb-server.c: Listening
> > at *:4242... ^C2014-09-02T08:45:14 DEBUG src/stlink-common.c: ***
> > stlink_run *** 2014-09-02T08:45:14 DEBUG src/stlink-common.c: ***
> > stlink_exit_debug_mode *** 2014-09-02T08:45:14 DEBUG
> > src/stlink-common.c: *** stlink_write_debug32 a05f0000 to
> > 0xe000edf0 2014-09-02T08:45:14 DEBUG src/stlink-common.c: ***
> > stlink_close ***
> >
> >
>
> - --
> Lari Lehtomäki
> lari at lehtomaki dot fi
> 050 320 7920
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1
>
> iQEcBAEBAgAGBQJUDdbMAAoJEJcuih5lizyqNUUH/3f1zJ3kMMI6Axd7qfvSYdxE
> uwfwkUPQ4olR0dBbLQHEJMQGj6WHsCi3BD/O1jY6ssMmjs1EKzepXbuKpsItlztf
> n1h+1VXoU+1GB9Njo1S94uBPaxhrVKzWfMJ/uJXk/q5tB1rWtuPIr9jyDIG8jylK
> jogcHuDxwy2fWBb9HVdppFF9mCQqmi6eGhzKf+0dyZzjL+fdrPzccqIlZMINb/MN
> AMkMjHgtmCCFb68Uxmv57pfilxYN9vGwhGbP+OxtTKKYIOeZVWSXvJNyM3/ew3JM
> MltckNKOqqMc4tZ7oWEAznRBk3ZyKgcadZrqzMLBTlUQ8oPXmGQMA1yIsFoj+6A=
> =0w5R
> -----END PGP SIGNATURE-----
>

Other related posts: