HelTecAutomation / platform-heltec-cubecell

Heltec Cubecell: development platform for PlatformIO
https://registry.platformio.org/platforms/heltecautomation/heltec-cubecell
Apache License 2.0
9 stars 5 forks source link

Update cubecell_board_v2.json #8

Closed eiannone closed 6 months ago

eiannone commented 6 months ago

As stated in the official product page (https://heltec.org/project/htcc-ab01-v2/), MCU should be asr6502

ivankravets commented 6 months ago

Thanks for the PR!

amirna2 commented 3 months ago

This change is actually causing a failure to build the cubecell_board_v2 with the following error:

Compiling .pio/build/cubecell_board_v2/FrameworkArduino/basic.cpp.o
Compiling .pio/build/cubecell_board_v2/FrameworkArduino/board/board.c.o
/Users/nathoo/.platformio/packages/framework-arduinocubecell/cores/asr650x/SPI/SPI.cpp: In member function 'bool SPIClass::begin(int8_t, int8_t, int8_t, int8_t)':
/Users/nathoo/.platformio/packages/framework-arduinocubecell/cores/asr650x/SPI/SPI.cpp:53:9: error: 'SCK1' was not declared in this scope; did you mean 'SCK'?
   53 |   sck = SCK1;
      |         ^~~~
      |         SCK
/Users/nathoo/.platformio/packages/framework-arduinocubecell/cores/asr650x/SPI/SPI.cpp:54:10: error: 'MOSI1' was not declared in this scope; did you mean 'MOSI'?

The reason for this is the pin_arduino.h variant for the cubecell v2 does not include the SPI definitions.

You can reproduce this with the blink example and adding this target

[env:cubecell_board_v2]
platform = https://github.com/HelTecAutomation/heltec-cubecell.git 
framework = arduino
board = cubecell_board_v2

If I switch back to the currently release platform version 1.1.0 as of writing, then it compiles successfully. However it's using the wrong chip definition. This seems to be okay and the code flashes and runs as expected, but it's a bit sketchy.

eiannone commented 3 months ago

@amirna2 , yes. Please see here: https://github.com/HelTecAutomation/CubeCell-Arduino/commit/4918068ac768c0056afa508a28149622284391b3 I'm not sure if its better to change pin map or update specific code.

valeros commented 3 months ago

Hi @amirna2, thanks for pointing it out. I believe the best solution would be asking @eiannone to submit a new PR with bugfix directly to the upstream Arduino core repository and then the maintainer @Heltec-Aaron-Lee could release a new version of the framework with the latest changes.

As a workaround you can manually declare missing pin definitions provided @eiannone directly in your platformio.ini:

[env:cubecell_board_v2]
platform = heltec-cubecell
framework = arduino
board = cubecell_board_v2
build_flags = 
    -DMOSI1=P4_0
    -DMISO1=P4_1
    -DSCK1=P4_2
    -DUART_RX2=P3_0
    -DUART_TX2=P3_1
    -DSDA1=P0_1
    -DSCL1=P0_0
eiannone commented 2 months ago

Ok, PR added here: https://github.com/HelTecAutomation/CubeCell-Arduino/pull/290