mcarlin

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

fhunleth

Co-author of Nerves

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

Where Next?

Popular in Questions Top

9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
tduccuong
Hi, is there any work on GUI with Elixir, that is similar to Electron/Javascript? My idea is to bundle Phoenix and BEAM into a single se...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New

Other popular topics Top

malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
RisingFromAshes
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement