PlatformIO Community

Building succeeds, uploading succeeds but the board fails to boot

Hi all,
I’m having issues with getting sketches to upload and run correctly using PlatformIO. The hardware I’m using is Heltec Cubecell (asrmicro650x)

The code would build fine, without errors. Upload would indicate success and I can verify that the old firmware on my board really does get deleted (Blink code I uploaded with Arduino IDE stops blinking the LED)

But after PlatformIO upload, the device does not get past bootloader. Not sure if the problem is with PlatformIO or with Heltec support for asrmicro650x

This is my .ini file:

[env:cubecell_node]
platform = asrmicro650x
framework = arduino
board = cubecell_node
monitor_speed = 115200
board_build.arduino.lorawan.region = EU868
board_build.arduino.lorawan.adr = ON
board_build.arduino.lorawan.debug_level = FREQ_AND_DIO

This is my code:
#include <Arduino.h>

void setup()
{
  // initialize LED digital pin as an output.
  pinMode(RGB, OUTPUT);
}

void loop()
{
  // turn the LED on (HIGH is the voltage level)
  digitalWrite(RGB, HIGH);
  // wait for a second
  delay(1000);
  // turn the LED off by making the voltage LOW
  digitalWrite(RGB, LOW);
   // wait for a second
  delay(1000);
}

And this is the upload output:

Auto-detected: /dev/ttyUSB0
Uploading .pio/build/cubecell_node/firmware.cyacd
Initialising bootloader.
Silicon ID 0x256a11b5, revision 0.
Verifying rows.
Array 0: first row 34, last row 511.
Starting upload.
Uploading ( 10 / 100 )
Uploading ( 20 / 100 )
Uploading ( 30 / 100 )
Uploading ( 40 / 100 )
Uploading ( 50 / 100 )
Uploading ( 60 / 100 )
Uploading ( 70 / 100 )
Uploading ( 80 / 100 )
Uploading ( 90 / 100 )
Uploading ( 100 / 100 )
Checksum verifies OK.
Rebooting.
Total upload time 3.24s
======================= [SUCCESS] Took 4.38 seconds =========================

Terminal will be reused by tasks, press any key to close it.

I don’t know this device at all, so please bear with me.

I’m assuming exacttly the same code works with the Arduino IDE and that thete are no changes except #include "Arduino.h".

I’m assuming that RGB is predefined simewhere in the code or toolchain/platform.

The compilation is working and apparently uploading, so I would think that PlatformIO is working.

Looking at the web for the device shows the developers mentioning bugs in the PlatformIO support back in June 2020. I would hope these are fixed now, but can’t be sure.

Maybe there is a bug in the compiler or supportlibraries. Unlikely, I admit.

Maybe the code uploaded is missing something that the Arduino IDE is doing? Not turning on interrupts? Not correctly defining pins? Difficult to track down though.

Might I suggest raising a support call with the board/firnware maintainers regarding the problem – given that the code compiles and uploads.

Sorry, not much help I’m afraid. :frowning_face:

Cheers,
Norm.

Thanks for taking a look at this @NormanDunbar

I’ve raised the issue on the manufacturer forums as well. But without much feedback so far. I posted on this forum in hopes that maybe it would be a known “rookie mistake” I’ve made somewhere.

You are correct in that the same code works fine when compiled and uploaded using Arduino IDE.

All in all, thank you again for offering your thoughts on the matter. Now I’m more confident that I need to look at the board/library for the culprit

1 Like

I have that that board and I can test. Let me check back.

What does the back of your board say? Mine is a CubeCell Board (AB-01) and when I choose that in the board selector, I get board = cubecell_board and not cubecell_node.

But that doesn’t seem to change a lot regarding the behavior. No RGB blinking.

But I do get normal serial output after putting in Serial.begin() and Serial.println() --> The pinout seems wrong. Let me check that.

Aha.

According to the schematics and code, the pin RGB maps to

#define RGB P0_7 //gpio4

which goes to

grafik

the DATA INPUT of a digital RGB LED, an SK6812.

So you can’t just “digitalWrite()” to it and expect things to happen – needs a special protocol. I’ll have a look.

Yeah. They have a library for it

Using that code (which uses an internal library) as src\main.cpp, the LED blinks immediately.

I’m using the platformio.ini

[env:cubecell_board]
platform = asrmicro650x
board = cubecell_board
framework = arduino

Well, there you go! @maxgerhardt you are a hero! :slight_smile: It was indeed a rookie mistake. I must have used some other means of creating the project. Because now when I started a fresh new project via PlatformIO start page and selected my hardware, it works correctly.

Thanks a lot for getting me on the right tracks :slight_smile:

2 Likes