Author Topic: Problem with STM32CubeProgrammer  (Read 6591 times)

0 Members and 1 Guest are viewing this topic.

Online IanJTopic starter

  • Supporter
  • ****
  • Posts: 2263
  • Country: scotland
  • Full time EE & Youtuber/Creator
    • IanJohnston.com
Problem with STM32CubeProgrammer
« on: December 17, 2019, 11:29:38 am »
Hi all,

New to STM32.

I modified one of my products from the ATMEL1284 to the STM32F103 and using the Arduino IDE it works great.

Now, due to the lack of support for the STM32L151/152 in the Arduino boards library I thought I'd give the ST-Link Utility and the STM32CubeProgrammer a go.
I can upload my hex file to the L151 using the ST-Link utility no problem (it appears), but with the STM32CubeProgrammer I can connect, I can read the contents out but I get an error when I tried to upload my hex file.
"Error: Flash loader cannot be loaded"
Also, I get an error when I try to erase sectors of the 151.
I am not using any external loaders.

I have tried my STLINKV3 as well as my STLINKV2 and get the same problem.

I have checked that nothing is write protected in settings and everything is as per default.

My ultimate aim is to find a workflow that I can write my C++ prog using the Arduino IDE and all my libraries, and use it on the L151/L152. I do NOT want to start from scratch and dump all my Arduino libraries etc.
Ideally, there would be a board in the Arduino IDE for the L151/L152 much the same as there is for the F103 etc.
I'm more a hardware engineer than a software guy!

Ideas to help an STM32 newbie along?

Ian.
« Last Edit: December 17, 2019, 01:25:39 pm by IanJ »
Ian Johnston - Original designer of the PDVS2mini || Author of WinGPIB, WinPartsFinder/MacPartsFinder
Website: www.ianjohnston.com
YouTube: www.youtube.com/user/IanScottJohnston, Twitter(X): https://twitter.com/IanSJohnston, Github: https://github.com/Ian-Johnston?tab=repositories
 

Offline thm_w

  • Super Contributor
  • ***
  • Posts: 9893
  • Country: ca
  • Non-expert
Re: Problem with STM32CubeProgrammer
« Reply #1 on: December 17, 2019, 10:32:28 pm »
Is there any need to use the CubeProgrammer if stlink utility is working?

Not exactly your question, but I would consider another IDE than the Arduino IDE which has direct support for programming and hopefully debugging: visual studio code, visualgdb, visualmicro, etc.
Profile -> Modify profile -> Look and Layout ->  Don't show users' signatures
 

Online IanJTopic starter

  • Supporter
  • ****
  • Posts: 2263
  • Country: scotland
  • Full time EE & Youtuber/Creator
    • IanJohnston.com
Re: Problem with STM32CubeProgrammer
« Reply #2 on: December 18, 2019, 08:38:14 am »
Is there any need to use the CubeProgrammer if stlink utility is working?

Not exactly your question, but I would consider another IDE than the Arduino IDE which has direct support for programming and hopefully debugging: visual studio code, visualgdb, visualmicro, etc.

Hi,

Visualgdb I tested out a couple weeks ago  but it has a problem using one of the STM32 Arduino board libraries which it simply imports. I reported to them but they just say it's not their problem even though it works perfect under the Arduino IDE.

I just wondered why I cant program with the cube programmer.

Ps. I am trying eclipse now, but I think they all use the same method of importing the same boards from the same sources.
I have created my own before, I.e. atmega1284 but that was relatively easy compared to STM32.

Ian.
« Last Edit: December 18, 2019, 08:55:12 am by IanJ »
Ian Johnston - Original designer of the PDVS2mini || Author of WinGPIB, WinPartsFinder/MacPartsFinder
Website: www.ianjohnston.com
YouTube: www.youtube.com/user/IanScottJohnston, Twitter(X): https://twitter.com/IanSJohnston, Github: https://github.com/Ian-Johnston?tab=repositories
 

Offline lordium

  • Regular Contributor
  • *
  • Posts: 62
  • Country: cn
Re: Problem with STM32CubeProgrammer
« Reply #3 on: December 18, 2019, 09:57:48 am »
Looking at your picture it does seems to detect your flash size wrong (so maybe also the other settings)... Can you try to read the options bytes and see if that works?

from datasheet you should have 32+32 in 2 banks for the option bytes but looks like you try to read 88?

0x1FF80000 to 0x1FF8001F
0x1FF80080 to 0x1FF8009F

EDIT: because I was curious I checked a little more. Seems your device has ID 0x429, but according to their database it should be 0x437 (assuming you have an 151RE). Either the device is wrong or their database. Maybe you can try to swap the ID in the database to trick the program (until ST fix the problem, if it is a problem).

C:\Program Files (x86)\STMicroelectronics\STM32Cube\STM32CubeProgrammer\Data_Base\STM32_Prog_DB.xml
« Last Edit: December 18, 2019, 12:24:40 pm by lordium »
 

Online IanJTopic starter

  • Supporter
  • ****
  • Posts: 2263
  • Country: scotland
  • Full time EE & Youtuber/Creator
    • IanJohnston.com
Re: Problem with STM32CubeProgrammer
« Reply #4 on: December 18, 2019, 07:45:20 pm »
Thanks for the info........hmmm, probably my fault. Looks like I compiled for one device whilst trying to upload to another. Not to mention I am having Java problems, Eclipse is conflicting with teh Cube programmer and when I fix one it breaks the other.

More work on my part required.

Ian.
Ian Johnston - Original designer of the PDVS2mini || Author of WinGPIB, WinPartsFinder/MacPartsFinder
Website: www.ianjohnston.com
YouTube: www.youtube.com/user/IanScottJohnston, Twitter(X): https://twitter.com/IanSJohnston, Github: https://github.com/Ian-Johnston?tab=repositories
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->