-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathcommon.lua
More file actions
19 lines (16 loc) · 919 Bytes
/
common.lua
File metadata and controls
19 lines (16 loc) · 919 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
-- Copyright lowRISC Contributors.
-- SPDX-License-Identifier: Apache-2.0
function convert_to_uf2(target)
local firmware = target:targetfile()
os.execv("llvm-strip", { firmware, "-o", firmware .. ".strip" })
os.execv("uf2conv", { firmware .. ".strip", "-b0x00000000", "-f0x6CE29E60", "-co", firmware .. ".slot1.uf2" })
os.execv("uf2conv", { firmware .. ".strip", "-b0x10000000", "-f0x6CE29E60", "-co", firmware .. ".slot2.uf2" })
os.execv("uf2conv", { firmware .. ".strip", "-b0x20000000", "-f0x6CE29E60", "-co", firmware .. ".slot3.uf2" })
end
function convert_to_vmem(target)
local firmware = target:targetfile()
os.execv("riscv32-unknown-elf-objcopy", { firmware, "-O", "binary" , firmware .. ".bin" })
os.execv("srec_cat", { firmware .. ".bin", "-binary",
"-offset" ,"0x0000", "-byte-swap", "4",
"-o", firmware .. ".vmem", "-vmem" })
end