stecman / hw-boot-selection Goto Github PK
View Code? Open in Web Editor NEWSTM32 firmware for a physical switch to set the GRUB boot selection
License: MIT License
STM32 firmware for a physical switch to set the GRUB boot selection
License: MIT License
This project is currently set up to build for just the STM32F070, including some specific configuration required for the F6 package of that chip that is unlikely to compile for other STM32 models.
To make this a little more accessible, it would be good to add support for building for the STM32F103, which is far more common on cheap development boards than the chip I've used.
I love the project and i'm very interested, dou you know if this is possible?
I bought a fresh STM32F103 (blue pill), as I initially bought a CKS32F103.
The problem now is, that the device will not be recognized as a USB device.
Aug 17 11:39:07 tobias-linux kernel: usb 1-4: new full-speed USB device number 115 using xhci_hcd
Aug 17 11:39:07 tobias-linux kernel: usb 1-4: Device not responding to setup address.
Aug 17 11:39:07 tobias-linux kernel: usb 1-4: Device not responding to setup address.
Aug 17 11:39:08 tobias-linux kernel: usb 1-4: device not accepting address 115, error -71
Aug 17 11:39:08 tobias-linux kernel: usb usb1-port4: unable to enumerate USB device
If I plug in my clone stm32, I will get the following
Aug 17 11:39:54 tobias-linux kernel: usb 1-4: new full-speed USB device number 116 using xhci_hcd
Aug 17 11:39:54 tobias-linux kernel: usb 1-4: device descriptor read/64, error -71
Aug 17 11:39:54 tobias-linux kernel: usb 1-4: New USB device found, idVendor=26ba, idProduct=8003, bcdDevice= 2.00
Aug 17 11:39:54 tobias-linux kernel: usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Aug 17 11:39:54 tobias-linux kernel: usb 1-4: Product: Boot Switch
Aug 17 11:39:54 tobias-linux kernel: usb 1-4: Manufacturer: Stecman
Aug 17 11:39:54 tobias-linux kernel: usb 1-4: SerialNumber: D000000000E7
Aug 17 11:39:54 tobias-linux kernel: usb-storage 1-4:1.0: USB Mass Storage device detected
Aug 17 11:39:54 tobias-linux kernel: scsi host7: usb-storage 1-4:1.0
But flashing was successful of the new real STM32.
$ make flash PROGRAMMER=stlink
LD boot-swtich.stm32f103c8.elf
OBJCOPY boot-swtich.stm32f103c8.bin
Firmware size (boot-swtich.stm32f103c8.elf):
text data bss dec hex filename
8128 112 1020 9260 242c boot-swtich.stm32f103c8.elf
Flash: 12% (8240 / 65536 bytes)
RAM: 5% (1132 / 20480 bytes)
BINARY=boot-swtich.stm32f103c8.elf openocd -f interface/stlink.cfg -c "transport select hla_swd" -f target/stm32f1x.cfg -f openocd.cfg -c 'program_and_run ()'
Open On-Chip Debugger 0.11.0-rc2
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
hla_swd
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
attach
Info : clock speed 1000 kHz
Info : STLINK V2J17S4 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.205253
Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for stm32f1x.cpu on 3333
Info : Listening on port 3333 for gdb connections
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080016a8 msp: 0x20005000
Info : device id = 0x10006412
Info : flash size = 32kbytes
shutdown command invoked
Do you have any idea? Unfortunately I'm no hardware programmer.
I'm thankful for any help :)
I get this output while executing make flash PROGRAMMER=stlink
:
LD boot-swtich.stm32f103c8.elf
OBJCOPY boot-swtich.stm32f103c8.bin
Firmware size (boot-swtich.stm32f103c8.elf):
text data bss dec hex filename
8128 112 1020 9260 242c boot-swtich.stm32f103c8.elf
Flash: 12% (8240 / 65536 bytes)
RAM: 5% (1132 / 20480 bytes)
BINARY=boot-swtich.stm32f103c8.elf openocd -f interface/stlink.cfg -c "transport select hla_swd" -f target/stm32f1x.cfg -f openocd.cfg -c 'program_and_run ()'
Open On-Chip Debugger 0.11.0-rc2
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
hla_swd
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
attach
Info : clock speed 1000 kHz
Info : STLINK V2J29S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.232848
Warn : UNEXPECTED idcode: 0x2ba01477
Error: expected 1 of 1: 0x1ba01477
openocd.cfg:16: Error:
in procedure 'program_and_run'
in procedure 'program' called at file "openocd.cfg", line 16
make: *** [Makefile:64: flash] Error 1
I'm new to st-link programming so any help is appreciated
Just wanted to let you know that I only got it working after I removed the "--no-floppy" option from the grub search command.
I also had to run dos2unix on all files before libopencm3 compiled properly. I got the error message: /usr/bin/env 'python\r' no such file or directory
Not really an issue, just wanted to share my experience. Amazing project by the way!
Hello, I have followed the instructions in this github and the hackaday post and while I am in linux I can mount the "drive" and see the FAT filesystem and files. However, when I drop to a grub shell and attempt to see the files I get this:
grub> ls (hd0)
Device hd0: No known filesystem detected - Sector size 512B - Total size 64KiB
I have another drive which is Arch Linux installation media and grub can identify that one as having a FAT partition just fine. Do you have any suggestions for how to debug this further?
Very happy with the project, not an issue, just i though it would be easier for some people if you add to the readme a couple things.
nativedisk
could also be used but it can make your grub not to know how to boot into windows as there is some problem with chainloader./boot/grub/grub.cfg
(eventhough it is not recommended), as if you edit /etc/default/grub
when you try to sudo update-grub
it wont work. Also just paste it at the end of the file.(This can seem straight forward, but it isnt for newbies).Would love to build one of these but I'm missing the components you're using. What are the models? Or names?
I recognize there's a similar issue that's already closed, but I have been unable to resolve the issue. I'll provide the same information.
My only thoughts are something has changed in the libopencm3 api making the usb initialization is not work?
Only warning i get when flashing is regarding nRST and i assume that is not related.
Let me know if anyone has any thoughts, thanks!
openocd-jlink.cfg
currently needs to be modified if someone wants to program their device using an ST-Link.
Allow specifying the programmer to use as a parameter to make flash
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.