Helpdesk

Ich hätte gerne die gleiche Funktionalität wie im vorletzten Posting in https://strompi.joy-it.net/helpdesk/212. Ich habe in https://github.com/joy-it/strompi3 geschaut, aber keine Anleitung zum Kompilieren - und auch kein `Makefile` gefuden.


Können Sie mir bitte sagen, wie ich eine angepasste Firmware kompilieren kann?


Danke,
Martin

Martin

19.03.21 14:50

Guten Tag Martin,


in unserem Downloadbereich gibt es eine Anleitung zur STM32CubeIDE. Diese sollte Ihnen weiterhelfen.


Mit freundlichen Grüßen


Nils (Joy-IT)

Nils

19.03.21 15:40

Super, danke. Die habe ich nicht als solche identifiziert.


Übrigens (aus reiner Neugierde): Wenn ich die Diskussion in https://strompi.joy-it.net/helpdesk/212 richtig verstanden habe, so verbindet der "Serialless ON/OFF" Jumper jumper nur den Ausgang des StromPi-µP mit dem Eingang 21 des RPi; somit wär es eigentlich egal, ob der µP diesen Ausgang setzt oder nicht setzt. Im Code finden sich nun eine Menge if-else-Abfragen, um zwischen serialless on/off zu unterscheiden. Ich frage mich nun, ob dies tatsächlich notwendig ist und ob es nicht einfacher wäre, den Ausgang immer zu setzen? Wenn es keinen Grund dafür gibt, dann würde sich das ganze serialless-Kauderwelsch auf folgendes verkürzen:


1. Der Pin, der anzeigt, ob die Stromquelle ausgefallen ist, kann vom Anwender entweder über den Jumper "Serialless ON" auf RPi's GPIO 21 gelegt werden oder über ein Kabel auf jeden beliebigen anderen GPIO. Dort kann dann ein Skript diesen GPIO überwachen und entsprechend reagieren. (Die Beschriftung könnte dann auf "Powerfail Indicator" und "GPIO 21" geändert werden.)


2. Die Konfiguration "Serialless On/Off" würde dann zu "Serial communication Enable/Disable".


Fände ich persönlich um soooo viel verständlicher!


Aber vielleicht habe ich das alles auch falsch verstanden ...

Martin

19.03.21 15:57

Ich habe soeben gesehen, das die Anleitung sehr Windows-zentriert ist. Kann ich das Ding auch unter Linux compilieren?

Martin

19.03.21 16:00

Hallo Martin,


wir danken Ihnen für die interessanten Vorschläge. Wir werden diese in unserer weiteren Planung bedenken.


Eine kurze Recherche hat ergeben, dass die STM32Cube IDE unter Umständen auch unter Linux verwendet werden kann.
Uns steht dafür jedoch keine Anleitung zur Verfügung, die wir anbieten könnten.


Mit freundlichen Grüßen


Niklas (Joy-it)

Niklas

23.03.21 12:55

Hallo Niklas,


Ich habe einen Windows-Rechner gefunden, STM32Cube IDE installiert und die Firmware so angepasst, dass (hoffentlich) alle Befehle, die den Pin setzen, ausserhalb von "if (serialLessMode) {}" stehen. (Wenn's funktioniert, mache ich gerne einen Pull Request auf github.)


Wenn ich aber - wie in der Anleitung auf Seite 13 beschrieben - auf den kleinen Käfer klicke, bekomme ich folgende Fehlermeldung:



No ST-LINK detected! Please connect ST-LINK and restart the debug session.



und nichts wird kompiliert.


Aber mit "Menü[gt]Project[gt]Build all (CTRL-B)" bekomme ich eine .elf-Datei (1012kB groß) im Pfad, den ich wie auf Seite 12 beschrieben gesetzt habe.


Ist das die richtige Firmware, die ich getrost flashen kann?


Was ist der Grund, dass das Ganze als "Debug" kompiliert wird?


Danke


Martin

Martin

23.03.21 20:29

Martin, when you press the debug button the first thing stm32cube is to check the presence of the debug device.. and then i may compile it..
If you get an elf error compiling, probabily you added a function that is not referenced... but i think it's not your case and it created the ELF file.
I was able to compile my source withput problmes, as got from git.
The ELF file is not the one to sent to the strompi, instead it's the bin file..
my local source dir is :
C:\mystuff\Electronics\st32\strompi3\strompi3\Debug

In the debug folder you will find RB-StromPi3.bin , the elf , the map and the list file, all with the same name..
the bin will be big some 30Kb.. and it's the one to flash.
Hope this helps.

Alex

24.03.21 09:30

Thanks, Alex, for your help. I checked and there is also a .bin file (30kB).


I could only compile it with "Build all (CTRL-B)", but not with the debug button, because of the error mentioned in my message.


Do you happen to know, why joy-it goes the debug path?


Martin

Martin

24.03.21 10:53

Martin, to debug you need a STLink Hardware debugger..
I'ts basically a USB to JTAG interface, as tou can see in the pdf... the ide with out the debugger will not start to debug.
Best regards.
Alex.

Alex

24.03.21 22:24

Well, that is obvious, that you need the STLink Hardware debugger to debug the µP. But the document is about compiling the firmware and not debugging it ... And it tells me, to compile it with the debug button. That is what confuses me.


Let's hope that joy-it chimes in to clarify it.


Best,
Stephan

Martin

25.03.21 09:02

Hi,


the manual was intentionally written for use with a debugger. But you're totally right, the correct command for compiling without debugging is "Build all". We are going to add this to the manual. Thanks for the hint.

Best regards


Nils (Joy-IT)

Nils

29.03.21 11:47

Thanks, Nils, for the the confimation.


When I started this post, I was looking for a manual how to compile the firmware. The name of the manual in the download area is "STM32CubeIDE Installation" was not the obvious canditate for such a manual. Maybe you want to change it to a more decriptive name, such as "How to compile the firmware", to help other people looking into compiling the firmware.

Martin

29.03.21 21:28

Hi Martin,


that's a good idea. Thank you.


Best regards


Nils (Joy-IT)

Nils

30.03.21 11:26