-
Notifications
You must be signed in to change notification settings - Fork 51
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 problem with setting #329
Comments
Workout looking into it, it's probably macro that has not been set in the PlatformIO build. DxCore's boards.txt adds various macros as build flags (-DSOMEVAL=1), and this has to be replicated in the PlatformIO build configuration. @brunob45 was the one that added DxCore support to PlatformIO, but the implementation has to be kept up to date for it to work with newer DxCore releases. |
Thanks for your info. Is brunob45 here on GitHub or on the PlatformIO forum? Basically I understand you that I can't use the DxCore with PlatformIO yet, because nothing works yet. Is there a way to flash using Atmel-ICE and still use the DxCore Package for programming? Then I also have to do without the bootloader. |
No you can use platform io and dx core (not the github head, but the last
release). I just knno nothing about platform io and I'm already working on
things 16 hours a day 7 days a week and falling further and further behind.
So I'm not going 6o take on learning a new ide. But it's totally possible
and somewhere I habe an open issue requesting help from people with the
necessary knowledge to write guides for alternative ides because I get tons
of questions about them that I can't answer. The only ide I know is arduino
…____________
Spence Konde
Azzy’S Electronics
New products! Check them out at tindie.com/stores/DrAzzy
GitHub: github.com/SpenceKonde
ATTinyCore: Arduino support for almost every ATTiny microcontroller
Contact: ***@***.***
On Fri, Aug 19, 2022, 16:22 mikrocoder ***@***.***> wrote:
Thanks for your info. Is brunob45 here on GitHub or on the PlatformIO
forum? Basically I understand you that I can't use the DxCore with
PlatformIO yet, because nothing works yet.
Is there a way to flash using Atmel-ICE and still use the DxCore Package
for programming? Then I also have to do without the bootloader.
—
Reply to this email directly, view it on GitHub
<#329 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABTXEW3QI6HNEWNZ2BD54N3VZ7UKDANCNFSM57A64EYA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
My time is quite limited, but I was pretty deep into the PlatformIO build system a while ago. You don't have to learn how to use it, but you should take into account how it gathers all the necessary bits and pieces from the platformio.ini project file before it starts the build. I also have various macros ( |
@MCUdude Thanks for the credits, but the Platformio team has taken over the porting of DxCore to Platformio IDE. As of right now, the DxCore version 1.4.10 is officially released: https://registry.platformio.org/tools/platformio/framework-arduino-megaavr-dxcore I have made a blink sketch for the AVR128DA48 here. It should work the same for a DB-series, but I can't test it as I only have DA-series chips. No need to set board_build.variant and f_cpu, the Platformio default values should be fine. |
Hello, Maybe you can help me. PlatformIO has only been freshly installed for a few days. The DxCore package is also up to date on 1.4.10 according to the output. Now I had to find out how to install 'pymcuprog'. Okay, it works. Error message about this is gone. However, it still does not work. A socket.py is supposedly not found. But it is definitely present in the path. What do I have to do?
Also, is this true for me at all? I want to flash via USB > FTDI232RL > USART bootloader > µC. Is the upload protocol the right one for me? In the Arduino IDE it all works.
Because of f_cpu. 16MHz are default. okay. But how does PlatformIO know how and with what I clock the controller? For me this is too much default and too much hidden settings. |
The solution is here: platformio/platform-atmelmegaavr#41 |
I will note that this is in essence a duplicate of #319. A lot of our users are on platformio, about which I know about as much as my cat knows about AVR assembly (which is to say, not very much - I mean, she can't even name a single instruction that got timing enhancements in AVRxt versus AVRe+. They deserve better docs. But right now the head doesn't compile blink so... priorities are priorities. What good would a document be it if just got them to the same compile errors as the Arduino IDE? |
@ Spence: Everything I can gather and test for myself, I can somehow merge into a documentation and publish in #319. Isn't that what you're asking everyone? |
@mikrocoder I will answer to the best of my knowledge. I did some work to port DxCore to PlatformIO a while back, but I haven't touch this since. The config you have can be translated as [env:avrdb]
platform = atmelmegaavr
board = AVR128DB64
framework = arduino
; Set clock speed & source - default is 24MHz internal
board_build.f_cpu = 16000000L
board_hardware.oscillator = crystal
; Set millis timer source - default is B2
board_hardware.millistimer = B2
; Set BOD level (fixed 32Hz) - default is Disabled
board_hardware.bod = 2.85v
; Set reset pin function - default is reset
board_hardware.rstpin = reset
; Cannot change startup time - default is 32ms
; Set bootloader serial port - default is no_bootloader
board_hardware.uart = ser2_alt
; Set MVIO - default is no
board_hardware.mvio_enable = no
build_unflags =
-DTWI_MORS_SINGLE ; Unset 1x Wire (enabled by default)
; -DCORE_ATTACH_ALL ; Uncomment to select another attach method
build_flags =
-DTWI_MORS_BOTH ; Set 2x Wire
; -DCORE_ATTACH_NONE ; Uncomment to select this attach method
; -DCORE_ATTACH_OLD ; Uncomment to select this attach method
upload_protocol = pkobn_updi
; Or try the other protocols: https://github.com/MCUdude/MegaCoreX/blob/master/PlatformIO.md#upload_protocol
; If none of the above work, use
; upload_protocol = custom
; upload_command = pymcuprog erase && pymcuprog write -f $SOURCE
; run the following command to set fuses
; pio run -t fuses
; run the following command to set fuses + burn bootloader
; pio run -t bootloader I've made a pull request (platformio/platform-atmelmegaavr#48) to improve DxCore support (added bootloader selection and millis timer parameter in the ini file), you can try by using the platform platform = https://github.com/brunob45/platform-atmelavrdx#dev/avrea |
Hi, Thanks for the help. I just had to change the upload setting. I flash with USB to USART (FTDI232RL) connector onboard.
Therefore I continue with USB connection for now. But what I already noticed and now still not working is the 16MHz crystal. When I remove the crystal, the led continues to blink. This means that the internal clock is still active. If I switch to 'external' nothing flashes. So far okay. With 'internal' and 'crystal' there must be an error in the detail. The PlatformIO universe is very large. 😉 In which file are all these settings? Where are they defined, what is default and what is optional? For example, the clock source must somehow lead to a register setting in the end so that it works. Then I could look once myself. PS: I can not this thread reopen. |
@mikrocoder
You can use Otherwise, I made the correction in my branch so platform = https://github.com/brunob45/platform-atmelavrdx#dev/avrea Also, the information is scattered into different files. The most interesting for you would be https://github.com/SpenceKonde/DxCore/blob/master/megaavr/boards.txt. It defines the output behavior for every menu in the Arduino IDE. The platformio part is handled by https://github.com/platformio/platform-atmelmegaavr/blob/develop/builder/frameworks/arduino.py . It's a Python script that parse the platformio.ini file and generate the compiler arguments. |
Hello, okay, thanks, helps a little.
|
Edit: my bad, the build_unflags should have been -DCLOCK_SOURCE=0. [env:avrdb]
platform = atmelmegaavr
board = AVR128DB64
framework = arduino
; Set clock speed & source - default is 24MHz internal
board_build.f_cpu = 16000000L
; Set millis timer source - default is B2
board_hardware.millistimer = B2
; Set BOD level (fixed 32Hz) - default is Disabled
board_hardware.bod = 2.85v
; Set reset pin function - default is reset
board_hardware.rstpin = reset
; Cannot change startup time - default is 32ms
; Set bootloader serial port - default is no_bootloader
board_hardware.uart = ser2_alt
; Set MVIO - default is no
board_hardware.mvio_enable = no
build_unflags =
-DCLOCK_SOURCE=0
-DTWI_MORS_SINGLE ; Unset 1x Wire (enabled by DEFAULT)
build_flags =
-DUSING_OPTIBOOT
-DCLOCK_SOURCE=1 ; crystal
-DTWI_MORS_BOTH ; Set 2x Wire
upload_protocol = arduino
upload_speed = 115200 |
Hello, thank you very much. Now it works. 👍 😀 |
I didn't think so, but apparently yes 😅 |
Hello,
do you know anything about PlatformIO? Somehow there is still one setting wrong.
I can compile and transfer a blinksketch but the led does not blink. What is wrong?
This is an AVR128DB64 with bootloader to which a FTDI232RL is connected and works with the Arduino IDE and your DxCore. It is flashed via USB > ComPort.
What is wrong set in PlatformIO?
platformio.ini
Output:
The text was updated successfully, but these errors were encountered: