-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PlatformIO support? #15
Comments
Hey ameeuw! |
Hi. Any progress? |
two way worked with platformio defined boards and pcakge in project
defined boards and package global
more info see Custom Development Platforms and Custom Embedded Boards |
Hi all, Just clone this repository into your |
@darkautism Does your code support the change of clock source and clock speed? |
@seisfeld It does not support now. Maybe next version. |
That would be nice, because running the chip at 32Mhz breaks certain Arduino libraries. The change to external clock source is also beneficial in certain cases. |
An example setting ; 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:LGT8F328P]
platform = lgt8f
board = LGT8F328P
framework = arduino
board_build.f_cpu=16000000L
;internal clock
board_build.clock_source=1 Example code: #include <Arduino.h>
void setup() {
Serial.begin(9600);
#if ((F_CPU) == 1000000)
#warning F_CPU = 1MHz
Serial.println("1MHz");
#elif ((F_CPU) == 2000000)
#warning F_CPU = 2MHz
Serial.println("2MHz");
#elif ((F_CPU) == 4000000)
#warning F_CPU = 4MHz
Serial.println("4MHz");
#elif ((F_CPU) == 8000000)
#warning F_CPU = 8MHz
Serial.println("8MHz");
#elif ((F_CPU) == 16000000)
#warning F_CPU = 16MHz
Serial.println("16MHz");
#elif ((F_CPU) == 32000000)
#warning F_CPU = 32MHz
Serial.println("32MHz");
#endif
#if ((CLOCK_SOURCE) == 1)
Serial.println("internal clock");
#elif ((CLOCK_SOURCE) == 2)
Serial.println("external clock");
#endif
while(1);
}
// the loop function runs over and over again forever
void loop() {
} Example output:
|
Parallel to that, some also integrated this core in PIO another way: https://github.com/rick3rt/framework-arduino-avr-lgt8f And also I integrated the original chinese Larduino core (v3.6c version): https://github.com/maxgerhardt/larduino-pio and https://github.com/maxgerhardt/Larduino_HSP Seems like we should combine our efforts to get one best version officially integrated into PlatformIO 😅 |
I'd welcome a PR on this :) |
The "Arduino Core" repository are separate from the "PlatformIO Platform" repository; The core files never contain any of the needed Python logic and JSON packaging descriptions for PIO. For example https://github.com/platformio/platform-ststm32 is the PlatformIO platform logic (available board descriptions, compilation logic, uploading logic, packages like compilers and uploads, ..) while https://github.com/stm32duino/Arduino_Core_STM32 is only 1 of like 4 underlying repos where the core / framework is sourced from. So really this repo is fine already, but there shouldn't be different divergent PlatformIO integrations for this core with differing board or configuration settings. |
I also tried to use your core in Platform.io today. There is just one file missing in your distribution - the package.json So I just added this file to the zip!
After that I added this section to the platformio.ini of my project in order to use your core as the framework-lgt8x. If you add this file to the release zip in the future it will be possible to just use a http reference to your file directly.
|
Has this been corrected in later releases? @xfjx can you verify? |
Hi dbuezas - great work on integrating all the parts of this chip for the Arduino IDE - it works perfectly!
As I am doing most of my projects in PlatformIO my question is whether it is possible to port the board definitions over?
Maybe someone else has experience and could chime in how much work this requires.
Thanks again. Best, Arne.
The text was updated successfully, but these errors were encountered: