Skip to content

Update uf2create task Raspberry Pi Pico 2 support #34

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -439,5 +439,6 @@ The `atomvm` properties list in the Mix project file (`mix.exs`) may contain the
| Key | Type | Default | Value |
|-----|------|----------|-------|
| `app_start` | Address in hexademical format | 0x10180000 | The flash address to place the application |
| `family_id` | atom or string | `universal` | The flavor of uf2 to create; `rp2040`, `rp2350_riscv`, `rp2350_arm_s`, `rp2350_arm_ns`, `data`, `absolute`, or `universal` |

Properties in the `mix.exs` file may be over-ridden on the command line using long-style flags (prefixed by `--`) by the same name as the properties key. For example, you can use the `--app_start` option to specify or override the `app_start` property in the above table.
17 changes: 13 additions & 4 deletions lib/mix/tasks/uf2create.ex
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ defmodule Mix.Tasks.Atomvm.Uf2create do
app_start =
parse_addr(Keyword.get(avm_config, :app_start, Map.get(options, :app_start, System.get_env("ATOMVM_PICO_APP_START", "0x10180000"))))
family_id =
validate_fam(Keyword.get(avm_config, :family_id, Map.get(options, :family_id, System.get_env("ATOMVM_PICO_UF2_FAMILY", "rp2040"))))
validate_fam(Keyword.get(avm_config, :family_id, Map.get(options, :family_id, System.get_env("ATOMVM_PICO_UF2_FAMILY", :universal))))

:ok = :uf2tool.uf2create("#{config[:app]}.uf2", family_id, app_start, "#{config[:app]}.avm")
IO.puts("Created #{config[:app]}.uf2")
Expand Down Expand Up @@ -72,9 +72,18 @@ defmodule Mix.Tasks.Atomvm.Uf2create do
"rp2040" -> :rp2040
":rp2040" -> :rp2040
:rp2040 -> :rp2040
"rp2035" -> :data
":rp2035" -> :data
:rp2035 -> :data
"rp2035_riscv" -> :rp2035_riscv
":rp2035_riscv" -> :rp2035_riscv
:rp2035_riscv -> :rp2035_riscv
"rp2035_arm_s" -> :rp2035_arm_s
":rp2035_arm_s" -> :rp2035_arm_s
:rp2035_arm_s -> :rp2035_arm_s
"rp2035_arm_ns" -> :rp2035_arm_ns
":rp2035_arm_ns" -> :rp2035_arm_ns
:rp2035_arm_ns -> :rp2035_arm_ns
"absolute" -> :absolute
":absolute" -> :absolute
:universal -> :absolute
"data" -> :data
":data" -> :data
:data -> :data
Expand Down