Skip to content
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

Create package.json #1071

Merged
merged 5 commits into from
Apr 8, 2024
Merged

Conversation

mechatroniks-git
Copy link
Contributor

Allows for easy platform.io platform_packages to be used.

See https://community.platformio.org/t/upgrading-individual-platform-packages/31731/4

@SpenceKonde
Copy link
Owner

Why is this pointing towards your git?

Please link to where the platform.json is documented so that I can construct a correct one that does not rely on external resources.

I can't move ahead with anything that relies on an personal account that is not my own, as in the future you could be compromised and the content replaced with malicious content, which I would then be tarred and feathered for. Or you could vanish and I could be flooded with support inquiries asking when it was fixed and could only say "Don't know, I don't know what he did, and he vanished", since I don't know shit about pio (which I gather this is for - I was looking into how to add this file myself a few days ago.

@SpenceKonde
Copy link
Owner

Does this file get deleted from the board manager install packages or not?

(when I do a board manager release, I use a script that (as of more recently than the last release was actually done) pulls the repo, uncompresses it, deletes the gargantuan uncompressable image files from megaavr/extras (which is also where the documentation is, while leaving in place compact image files (just based on file type, as it happens that the gigantic files I don't want in the board manager downloads all have the same file extension and similar names), moves everything up a folder level because Arduino needs that for board manager, then performs some crude edits to the platform.txt (it changes the path of the SerialUPDI upload to where board manager installs it, rather than where a sane person would manually place it. Repo points towards the sane location for development with manual installation, whereas the releases have that corrected.)

Is there a way to point them to the github zip file of the most recent release? It is not unusual for the repo to spend a long time between releases like, totally busted as I tackle a major change, (which was started intentionally only after doing a release, since I knew it was going to potentially hose things for a while). Automatic installs are meant to just work, so I only want to use actual releases for that (hell, my track record with those is nothing to write home about, except maybe to complain, but it's miles better than the repo itself.),

@SpenceKonde
Copy link
Owner

Can you please clarify these points? I know there are a lot of PIO people who would like a feature like this, I hate getting questions from them that I can't answer so anything that will make fewer people complain about installation problems, and more people use a version from the modern era, instead of versions of the core that are so old that I was writing the documentation in hieroglyphics, that's a good thing. The PIO users are either extremely numerous, or the world's squeakiest wheels.

@SpenceKonde SpenceKonde added the Information Required Information required from reporting user to begin/continue development work label Apr 5, 2024
@mechatroniks-git
Copy link
Contributor Author

mechatroniks-git commented Apr 6, 2024

Apologies for switching to my git, was trying to pull it from there. It's been reverted.

To the best of my knowledge, all we need to do is include the (corrected) package.json so that platform.io can pull it from github, as opposed to 2.6.7 which they have in their package. Then the platformio user brings in the github version using platform packages.

I don't think it needs to be in the boards manager install package, as platform.io doesn't really use anything from Arduino.

platform_packages looks like it can pull from a commit or from a zip, an example I found here:
platform = https://github.com/tasmota/platform-espressif32/releases/download/v2.0.3rc1/platform-espressif32-2.0.3.zip

or a release
platform_packages = framework-arduinoespressif32@https://github.com/espressif/arduino-esp32.git#idf-release/v3.3

So ideally, if it gets added to the zip, we can use:
platform_packages = framework-arduino-megaavr-megatinycore@https://github.com/SpenceKonde/megaTinyCore/archive/refs/tags/2.6.10.zip

@mechatroniks-git mechatroniks-git removed their assignment Apr 6, 2024
@SpenceKonde
Copy link
Owner

Great, thanks. It will be done on all cores from the next release.

coupla questions

So, SerialUPDI as you may know has a dependance on python (specifically python3); it's one of the "tools" that we install when installed via arduino ide board manager). How should I deal with that dependance for SerialUPDI? Just document that python3 must be in the path if they want to use SerialUPDI? (that means separate release file for PIO, of course, as the other two cases will have it in a specific place given as the full path after Arduino does it's substitution on platform.txt) Rip out SerialUPDI entirely?

Also, what is the directory structure supposed to be? ("the same as Arduino" does not answer this question, because it does not uniquely identify a directory structure, because it's different when installed via board manager and manually....

Do you happen to have a paragraph I could insert into the installation documentation to explain to to the platformio'ers how that json file gets used and what they need to do?

@SpenceKonde SpenceKonde merged commit 6844a18 into SpenceKonde:master Apr 8, 2024
6 of 9 checks passed
@mechatroniks-git
Copy link
Contributor Author

Yeah, I can create an example structure and docs for this. But essentially, it is a straightforward platformio project, add libraries and modify the platformio.ini file something like this below - which references the same python that Arduino calls.

; 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:ATtiny1624]
platform = atmelmegaavr
framework = arduino
board = ATtiny3227
board_hardware.oscillator = internal
board_build.f_cpu = 10000000L
board_hardware.bod = disabled
board_hardware.eesave = yes
board_hardware.rstpin = updi
upload_protocol = custom
upload_speed = 230400
upload_port = /dev/cu.SLAB_USBtoUART
build_flags = -DMILLIS_USE_TIMERB0=1
upload_flags =
	--tool
	uart
	--uart
	$UPLOAD_PORT
	--clk
	$UPLOAD_SPEED
	--device
	$BOARD
upload_command = 
C:/Users/winpc/AppData/Local/Arduino15/packages/megaTinyCore/hardware/megaavr/2.5.11/python -u C:/Users/winpc/AppData/Local/Arduino15/packages/megaTinyCore/hardware/megaavr/2.5.11/tools/libs/pymcuprog/prog.py $UPLOAD_FLAGS -wd 1 --fuses 0:0b00000000 2:0x02 6:0x04 7:0x00 8:0x00 -f $SOURCE -a write -v

In this file, I'll also add in a platform_packages call to override the 2.6.7 megatinycore that platformio still uses.

@SpenceKonde
Copy link
Owner

SpenceKonde commented Apr 9, 2024 via email

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Information Required Information required from reporting user to begin/continue development work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants