I've been trying to figure out how to upload a code to a STM32103c8T bulepill board.
My setup is
1- MacOs Catalina
2- STM32103c8T bulepill board
3- SLAB UART USB-TTL CP2012 V3.0
4- Platformio IDE
5- STM32 CUBE Programmer software which detects and connects to my board through UART.
meaning that It has no problem connecting but there are issue with setting up the Platformio
BTW I am new to the ARM world and I bought this board to examine its speed and deep sleep and interrupt, I mean all the things that an Arduino Uno can't do.
The thing is I have no idea on how to setup the platformio.ini File to comunicate with the board
using the UART method and not requesting ST-link dongle!
What I have now in Platformio.ini is:
[env:bluepill_f103c8]
platform = ststm32
board = bluepill_f103c8
framework = arduino
upload_protocol = stlink
upload_port = tty.slab_usbtoUART
and when trying to upload the program i get:
Uploading .pio/build/bluepill_f103c8/firmware.elf
xPack OpenOCD, x86_64 Open On-Chip Debugger 0.10.0+dev-00378-ge5be992df (2020-06-26-12:31)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
debug_level: 1
hla_swd
none separate
Error: open failed
in procedure 'program'
OpenOCD init failed
shutdown command invoked
[upload] Error 1
I just need help getting the system talk to each-other and see each-other
P.S.
I want to go as bareMetal as possible and not to use arduino firmware HAL
You can use the following configurations:
upload_protocol = serial
upload_port = COMX/ttyx //whichever applies
Related
I am trying to run a simple hello world sketch using Visual Studio Code for ESP32. To upload and to see the response,
I typed "idf.py flash monitor" in terminal. It uploads successfully, but after upload, the messages said:
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x3 (DOWNLOAD_BOOT(UART0/UART1/SDIO_REI_REO_V2))
waiting for download
I am using ESP32 development board. 38 pin board.
Here, I have attached the screen shot.
So far I have worked only in Arduino IDE. I am new to ESP-IDF. What is the problem here?
You just have to select exactly the chip to correctly set the boot address at https://micropython.org/download/esp32/
for example, for the ESP32 Vendor: Espressif, Features: BLE, WiFi1, is
0x1000, with the command
esptool.exe --chip esp32 --port COM4 --baud 460800 write_flash -z 0x1000 esp32-20190125-v1.10.bin
The boot rom detects the state of the gpio boot pin when it's powered up. That pin is connected to a button on development boards. If the button is pressed while powering up, software reset will go to download mode rather than booting from the flash.
So the solution is to not press the button while powering up the board. In some cases maybe the button state is incorrectly detected, so just repower the board in that case.
press the boot button and then click reset button.
it worked out for me
I'm trying to connect my Arduino Nano RP2040 with MicroPython to my local WiFi network and make a HTTP request.
The Nina W102 uBlox module on the board is an ESP32 and connects to the RP2040 via SPI (I'm not sure what this means but I thought it might be relevant).
I've found this code snippet that seems to do what I want
def do_connect():
import network
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
if not wlan.isconnected():
print('connecting to network...')
wlan.connect('SKYNET', 'G1V31NT3RN3T')
while not wlan.isconnected():
pass
print('network config:', wlan.ifconfig())
do_connect()
But it breaks with:
Traceback (most recent call last): File "", line 1, in
ImportError: no module named 'network'
Im using Thonny as an editor and tried to search their packages for something called "Network" and found a match. But that gives me the below error/warning.
Any help or tips greatly appreciated.
UPDATE 1: Found this example with WiFi using CircuitPython. Would prefer to use MicroPython, but if all else fails I might have to switch firmwares.
https://learn.adafruit.com/circuitpython-on-the-arduino-nano-rp2040-connect/wifi
UPDATE 2: Opted to use CircuitPython. Getting WiFi was then quite easy.
Raspberry Pi Pico does not have any network capability.
Your provided code looks like from micropython for chips, that has wifi inside (ESP family, some others)
Looks like Arduino RP2040 board has wifi option, but via Nina W102 uBlox, using SPI, witch is ESP32 under the hood. Probably, Nina's firmware is to provide WIFI/BLE and being controlled via SPI.
I assume, Adafruit wrote circuitpython driver to control Nina chip. My wild guess is that Nina uses AT+ commands. Sometimes circuityphons libs works on micropython. If that is not the case this time- you need network driver for it. Quick search did not gave me any result.
Conclusion- use Circuipython or write/find driver for Nina on Micropython
I am trying to program the STM32F401 flash on our board in DFU mode. I am using the dfu-util tool in my linux computer.For my project requirements the BOOT 0 pin is always kept high throughout the process.
I am using the following command to flash and jump to application code.
dfu-util -a 0 -s 0x08000000:leave -D <location-to-binary>.bin
After the flashing is done I can see through 'lsusb' command that sometimes the MCU is not out of DFU boot loader, and sometimes out of it. Either way the application does not start.
When I further try to use the leave command when it's in bootloader, it shows the following log and the above situation continues,
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2021 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
Opening DFU capable USB device...
Device ID 0483:df11
Device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Interface #0 ...
Determining device status...
DFU state(10) = dfuERROR, status(10) = Device's firmware is corrupt. It cannot return to run-time (non-DFU) operations
Clearing status
Determining device status...
DFU state(2) = dfuIDLE, status(0) = No error condition is present
DFU mode device DFU version 011a
Device returned transfer size 2048
DfuSe interface name: "Internal Flash "
DfuSe command mode
Submitting leave request...
Transitioning to dfuMANIFEST state
Thanks in advance for any advice or help.
I found the issue. I had to uncomment the define USER_VECT_TAB_ADDRESS in the system_stm32f4xx.c file.
Basically what was happening was that bootloader was looking for a loadable vector address from the flash application. With the USER_VECT_TAB_ADDRESS commented the pointer to the vector address kept pointing to the bootloader vector table effectively crashing the flash application resetting the controller. With the BOOT 0 pin high it kept loading into bootloader with each reset.
More information about this is available in this similar question:
STM32G474 bootloader exit
I have an embedded board with an STM32 microcontroller, and an ST-Link v2. This setup generally works: I can program the flash, and connect with ST's CubeProgrammer tool or with openocd. I can attach gdb to the latter, and step through code. So far, so good. It does not appear there is any problem with my physical or electrical setup.
I have a program which is... not so good. Something early in initialization is hanging up the chip to the point where I can no longer connect to it with any tools. I can rescue it by using the "Under reset" mode of CubeProgrammer, holding the reset switch on the board at boot, then connecting before the bad program can wedge the chip.
After connecting this way, the chip is halted. I can flash a known good program. Or, I can use the MCU core screen of CubeProgrammer to "Step" one instruction at a time through the bad program's startup. That works, until I hit "Run", and then I quickly get a dialog "Warning: Connection to device 0x411 is lost", and the chip is no longer usable until I flash it as above. It appears the code is configuring the necessary pins into the alt mode to enable serial wire debugging, so I don't think that's the problem, but it's hard to verify.
So, it appears something in this program is behaving badly. What I'd like to do is set up gdb via openocd to debug startup. With a good program, I can connect with openocd while the program is running, attach gdb, and everything works normally. But I don't know how to get openocd to do what CubeProgrammer does with the "Under reset" mode, so I can execute initialization of the chip under gdb control.
How can I do this? Or, is there some other tool I should be trying than openocd+gdb? I'm familiar with gdb, but I can try other tools. The host environment is macOS.
Create an openOCD config file like this:
#
# stlink to stm32f2xx by swd with system reset and no test reset
#
source [find interface/stlink.cfg]
transport select hla_swd
source [find target/stm32f2x.cfg]
reset_config srst_only connect_assert_srst
And use the -f flag to openOCD to use it.
I have been trying to locate a working library for the MSR605X magnetic card reader/writer. At time of writing, I have tried five separate libraries. Only two of these were explicitly for the 605X the other three were for the older 605. All the libraries I have tried either did nothing at all or errored before completing a command (can't figure out the errors either).
I am running Raspberry Pi OS 32 bit on a Raspberry Pi 3 B+ the MSR605X communicates via a USB connection.
So far the library that seems to be most complete is: https://pypi.org/project/msrx/
However, I can not get this library to read or write (either nothing happens or I get a Serial exception "cannot reconfig port).
Any help or links to documentation for this reader is welcome.
EDIT: Adding the commands ran with the above library
msrx -D /dev/input/event4 read
msrx -D /dev/input/jso0 read
The -D is to specify the device path (default is /dev/ttyUSB0 which doesn't exist on my system). I obtained the above two paths by searching for USB serial devices then matching the search result to the device ID which I obtained from lsusb.
Running these commands results in a serial exception (could not reconfig port) which I assume means that I have the wrong device path. I have also checked for any tty* device paths that are changed when I plug in the reader. I consistently get a permission denied error whenever trying to run the above commands with a tty* device path (I am root on this system).
msrx author here — MSR605 requires an external 9V power injected into its cable (via the barrel jack port), otherwise it won't power up properly.