Skip to content

Commit 7fe23fa

Browse files
committed
Update uf2create task Raspberry Pi Pico 2 support
Updates binary formats to updated uf2tool formats, changes the default format to univeral, which is compatible with all Pico SOCs. Signed-off-by: Winford <[email protected]>
1 parent 434f730 commit 7fe23fa

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,5 +439,6 @@ The `atomvm` properties list in the Mix project file (`mix.exs`) may contain the
439439
| Key | Type | Default | Value |
440440
|-----|------|----------|-------|
441441
| `app_start` | Address in hexademical format | 0x10180000 | The flash address to place the application |
442+
| `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` |
442443

443444
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.

lib/mix/tasks/uf2create.ex

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ defmodule Mix.Tasks.Atomvm.Uf2create do
1313
app_start =
1414
parse_addr(Keyword.get(avm_config, :app_start, Map.get(options, :app_start, System.get_env("ATOMVM_PICO_APP_START", "0x10180000"))))
1515
family_id =
16-
validate_fam(Keyword.get(avm_config, :family_id, Map.get(options, :family_id, System.get_env("ATOMVM_PICO_UF2_FAMILY", "rp2040"))))
16+
validate_fam(Keyword.get(avm_config, :family_id, Map.get(options, :family_id, System.get_env("ATOMVM_PICO_UF2_FAMILY", :universal))))
1717

1818
:ok = :uf2tool.uf2create("#{config[:app]}.uf2", family_id, app_start, "#{config[:app]}.avm")
1919
IO.puts("Created #{config[:app]}.uf2")
@@ -72,9 +72,18 @@ defmodule Mix.Tasks.Atomvm.Uf2create do
7272
"rp2040" -> :rp2040
7373
":rp2040" -> :rp2040
7474
:rp2040 -> :rp2040
75-
"rp2035" -> :data
76-
":rp2035" -> :data
77-
:rp2035 -> :data
75+
"rp2035_riscv" -> :rp2035_riscv
76+
":rp2035_riscv" -> :rp2035_riscv
77+
:rp2035_riscv -> :rp2035_riscv
78+
"rp2035_arm_s" -> :rp2035_arm_s
79+
":rp2035_arm_s" -> :rp2035_arm_s
80+
:rp2035_arm_s -> :rp2035_arm_s
81+
"rp2035_arm_ns" -> :rp2035_arm_ns
82+
":rp2035_arm_ns" -> :rp2035_arm_ns
83+
:rp2035_arm_ns -> :rp2035_arm_ns
84+
"absolute" -> :absolute
85+
":absolute" -> :absolute
86+
:universal -> :absolute
7887
"data" -> :data
7988
":data" -> :data
8089
:data -> :data

0 commit comments

Comments
 (0)