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.

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

Yep the flags=0x4 works. Sorry about the markup, not very good at that yet. Thanks for the help! Will post an issue to fwup as you suggested. If you are interested will keep you posted on progress with nerves on the STM32MP1 series.

Yes - quite interested. I have an Octavo OSD32MP1-BRK on my desk waiting to be used. I just haven’t had time to do much more than simple Buildroot experiments with it yet. Thanks!

Cool! We are using the Octavo OSD32MP1 for our target application. Do you know if the OSD32MP1-BRK eval board is using the production parts or Engineering samples? The production parts increase the Cortex core frequency to 800 MHz from 640 MHz.

Is this the correct forum to ask questions about implementing Nerves on the STM32MP1 series processors? Very new to OSS, only built my first Linux kernel last week (for the ST eval board). Still trying to get hello_leds to work properly…

Thanks again!

The OSD32MP1-BRK board that I have has a production part on it. The person who’s making the boards told me that the ones that he’s making all have production parts on them now. Just to be clear, I’m really can’t answer too many questions on the board or processor - I just happen to know Mark Shaw, the designer of the BRK, and the factory they’re using pretty well. Also, a while back, I ported Buildroot to the board for him to test it. You can find it here. I’m guessing that you’re farther along, but blinking LEDs works with it (not Nerves, but embedded Linux) and there might be a hint.

As for where to ask questions on Nerves, people ask them both here and on the #nerves channel on the Elixir Slack. I prefer the forum since it’s much easier to search. The Slack channel is a pretty friendly place too, and some people monitor it more actively since they’re already logged on to Slack for work. I use both.

Mostly, though, welcome to the Nerves and Elixir community!

Yeah I can turn the led on or off through the elixir console
using Nerves.Leds.set, something not working with the trigger:
“timer” business. Erlang timer looks to be working, at least I
can time some functions using :timer.tc

Thanks for the community welcome! I’m sure that we will cross
paths again on the forum.