mcarlin
Nerves fwup.conf for STM32MP157C-DK2
Hi,
First time nerves/elixir/elinux user here. Hope this is the correct place to post a question like this, I have looked through the github documentation for fwup but couldn’t find an answer. Hopefully didn’t miss something there.
I’m prototyping nerves on the STMicroelectrons STM32MP157C-DK2 for a custom board that we are developing that is in the beginning of schematics. I have the nerves-system up and running, got the examples to work fine. But, in order to boot properly, I have to run an external command to mix firmware.burn to set the boot flags in the protective MBR. Here is my partition structure:
±---------------------------+
| GPT |
±---------------------------+
| Firmware configuration data|
| (formatted as uboot env) |
±---------------------------+
| p0: fsbl1 |
| u-boot-spl.stm32 |
±---------------------------+
| p1: fsbl2 |
| u-boot-spl.stm32 |
±---------------------------+
| p2: ssbl |
| u-boot.img |
±---------------------------+
| p3: Rootfs A |
| rootfs.squashfs |
| zImage |
| stm32mp157c-dk2.dtb |
| root filesystem |
±---------------------------+
| p4: Rootfs B |
| rootfs.squashfs |
| zImage |
| stm32mp157c-dk2.dtb |
| root filesystem |
±---------------------------+
| p5: Application (f2fs) |
±---------------------------+
The commands I run to set the boot flags are:
>sudo sgdisk -A 4:set:2 /dev/sdb
>sudo sgdisk -A 5:set:2 /dev/sdb
Is there a way to either do this with fwup, or integrate a post firmware.burn script into mix? I’ve tried the following in fwup.conf:
partition 3 {
guid = 5278721d-0089-4768-85df-b8f1b97e6684 # ID for partition 3 (create with uuidgen)
type = 0fc63daf-8483-4772-8e79-3d69d8477de4
name = “rootfs”
block-offset = ${ROOTFS_A_PART_OFFSET}
block-count = ${ROOTFS_A_PART_COUNT}
boot = true
}
If uncommented, the boot=true causes fwup to error out. Thanks for any responses.
First Post!
fhunleth
Cool. I like that processor quite a bit and would love to have Nerves running on it.
Something weird happened with the markup of your post, but I think that I have the gist.
Instead of boot=true in the partition 3 {...} block, could you try flags=0x4? The 0x4 comes from the partition attribute flags here for the legacy boot flag. I think that the 2 in set:2 is for bit 2 which would be 0x4. If this doesn’t work, a hex dump of the gpt header would be useful.
If this works, could you post an issue to fwup? It does seem like boot=true should set this flag (assuming that this works).
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









