Closed tonyxforce closed 1 year ago
Which exact dev board are you working on? Have you tried lowering the upload speed to e.g.
upload_speed = 115200
in the platformio.ini
? The default is 2 million (baud).
My bad, this will not work, the baud rate is handled internally in the script. It's 500k at the sync and 2M at the second stage.
https://github.com/Community-BL-IOT/pio-bl60x-flash/blob/main/bl602-flasher.py#L212-L224
Have you tried using a different USB-UART converter that can handle these high speeds? Like an FTDI FT232R instead of a CH340.
This is my platformio.ini file:
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:pinecone_bl602]
platform = https://github.com/Community-BL-IOT/platform-sifive.git
board = pinecone
framework = arduino
monitor_speed = 115200
i have tried both 115200 and 2000000 but i dont have another UART converter only one that has a CH340G maybe can i use an arduino leonardo?
can it be a problem that i dont have either RTS or CTS pin of the UART converter connected anywhere?
Per docs the UART bootloader does not support RTS/CTS, it's just RXD and TXD. The script seems to use these pins regardless as maybe a reset, but that then depends on the board hardware. Often times it's used to reset chip via a capacitive connection from RTS or CTS do the RESET pin of the chip. If you haven't done so, you can try pressing reset right before the upload starts because the bootloader does have 2 second timeout.
A Leonardo uses 5V logic level, so to convert it to e generic USB-UART adapter you'll have to use a resistor divider from its TX to the BL602's RX. (In the reverse path from BL602's TX to Leonardo's RX no such thing is needed). Further the sketch has to be able to cope with dynamically changing baud rates. This could be solution to that.
Are you using a Pine64 Pinecone board or a different one?
You can also try different flashing software, e.g. the Boufallo Lab Dev Cube software from https://dev.bouffalolab.com/download.
Are you using a Pine64 Pinecone board or a different one?
im using a $2 magic home rgb led driver board
Just open the program, select BL602/4, go to the "IOT" tab, select your UART port on the right, set address as 0x10000, select the .bin file that PlatformIO produces are you hit "Build" (.pio/build/pinecone_bl602/firmware.bin
), make sure your board is in bootloader mode (on my board hold down the D8 button, press reset, release reset, release D8) and press Create + Download.
Works nicely.
I can't seem to find firmware.bin, can i use firmware.hex?
I tried that and got this errror:
There currently is a bug where the bin
is only created when you use the "Upload" project task. So execute that once and you should have the firmware.bin file, even if PlatformIO upload fails.
If you're getting a handshake error then the chip may not be in bootloader mode or you need to reset it again. You may also try to reduce the baud rate.
i figured it out, my 3.3v line had contact issues (i was using a jumper cable), now it errors out while trying to read mac address
(error code 0023)
Does it upload via PlatformIO's "Upload" task now normally maybe?
Have you tried power-cycling + resetting it?
Does it upload via PlatformIO's "Upload" task now normally maybe?
still the same error
Have you tried power-cycling + resetting it?
The board doesn't have a "reset" button so when i need to reset it i unplug the power connector, and i plug it back in (while connecting BOOT(flash) pin and 3.3v) I have gone in and out of programming/flashing mode quite a few times, so i did reset it a few times
Also, this is my setup if that is any help:
UART converter - bl602
RXD - TX TXD - RX GND - GND CTS - not connected (nc) RTS - nc 3.3v - nc
also bl602 BOOT and 3.3v is connected to some loose wires that i connect togedher on powerup
I just found this: https://github.com/Community-BL-IOT/ArduinoCore-bouffalo
Should i try to use this with the arduino 1 ide?
tried it, same error as in platformio
Unsurprising since it uses the same upload tool as we do in PlatformIO.
I'd recommend to just get a new USB-UART of type CP2102 or FT232R to rule out problems due to the CH340. The DT-10 dev-board I use has a CP2102 on-board.
Test it out. If you hold the ESP8266 in reset (CHIP_PD) so that it lets go of TX/RX it may work. Otherwise such an adapter can be bough for like 7€..
i tried it and IT WORKED! that was the problem, now both the buffalo dev cube and platformIO can upload code to it now i have to figure out how to write usable code for it
Great! The Arduino core is at a very rudimentary state right now with only GPIO, Serial, I2C and SPI implemented. So not even WiFi. But we do support writing applications against the native Boufallo SDK that has those capabilities, see example. Or you take it as an oportunity to help improve the Arduino core.
i tried to upload using the readme 1) i pulled BOOT pin to 3.3v 2) turned on chip 3) removed the bridge between 3.3v and BOOT 4) pressed upload on pio
ouput: