boards: arm: Adjust xiao_ble for default bootloader.#1
boards: arm: Adjust xiao_ble for default bootloader.#1petejohanson wants to merge 0 commit intomniestroj:boards-xiao-blefrom
Conversation
mniestroj
left a comment
There was a problem hiding this comment.
I didn't try it yet, but some early feedback.
boards/arm/xiao_ble/doc/index.rst
Outdated
There was a problem hiding this comment.
Great addition! Tough
Flashing
========
section now needs to be either nested under
External Debugger
=================
or rephrased or something. It is misleading to have UF2 Flashing and Flashing at the same level, as it is now.
There was a problem hiding this comment.
Fixed, I changed both Flashing and Debugging to be nested one level deeper. That work for you?
a288cf0 to
0d67043
Compare
| can use an External Debug Probe to program the board. If you have one, you can | ||
| also use an external :ref:`debug probe <debug-probes>` to flash and debug | ||
| Zephyr applications, but you need to solder an SWD header onto the back side of | ||
| the board. |
There was a problem hiding this comment.
Do you wanna mention the expansion board here? https://wiki.seeedstudio.com/Seeeduino-XIAO-Expansion-Board/
That's what i'm using. it's got pogo pins that match the bottom 4 pins. It does work for me, but there's not a wiring tutorial yet. I'm using an nrf51 dk to do the flashing.
There was a problem hiding this comment.
I don't have one, but that might be a good idea. @mniestroj thoughts? I can add here, or you can add yourself.
There was a problem hiding this comment.
Yeah, it is a good idea to mention expansion board. Personally for some reason I thought that the expansion board is not compatible with XIAO BLE series.
There was a problem hiding this comment.
It says on the page that the expansion board is not supported, but there are no reasons given. I asked in their discord, and i couldn't get an answer there either. They do say it will be supported, but also no timeline or mention of the mechanism.
However, I'm able to use the onboard OLED display with an arduino demo sketch and flash the device with jlink/nrfjprog via the pogo pins.
I need to try again, but I'm pretty sure I was able to use it with a battery as well.
So I guess what i'm saying is that they say it doesn't work, but it is definitely useful for a fair amount of things.
| boot_partition: partition@f4000 { | ||
| label = "adafruit_boot"; | ||
| reg = <0x000f4000 0x0000c000>; | ||
| }; |
There was a problem hiding this comment.
Can this support both the mcuboot way and the original bootloader? I"m not that familiar with this aspect.
There was a problem hiding this comment.
Not with the exact same board DTS, that I know of. Usually if you wanted to override something like that, you'd add a board specific overlay file to your application and then update the DTS w/ the correct partitions.
I don't believe Zephyr supports multiple partition "tables" in the DTS, that I've seen/been able to find.
There was a problem hiding this comment.
ah. i was hoping you could use chosen nodes for this to pick different default. The default adafruit bootloader and one more aligned with mcuboot. I won't be getting to this aspect of my program for a bit longer, so i'm not that familiar with this part. Maybe that's all wrong.
There was a problem hiding this comment.
There are certainly chosen nodes for the code region, slots, etc, but I couldn't find a chosen node to select the whole set of partitions.
There was a problem hiding this comment.
Yeah, there is no such mechanism yet. I think there was some thread on some PR to create something similar, but that never got upstreamed AFAIK.
faa2f19 to
2bb5ce3
Compare
|
@petejohanson I've tested this PR. Looks like there were some whitespace issues in DTS (checkpatch was complaining about) and also |
|
Ah, indeed. Sorry for missing that. Thanks for integrating! |
This patch reworks how fragments are handled in the net_buf infrastructure. In particular, it removes the union around the node and frags members in the main net_buf structure. This is done so that both can be used at the same time, at a cost of 4 bytes per net_buf instance. This implies that the layout of net_buf instances changes whenever being inserted into a queue (fifo or lifo) or a linked list (slist). Until now, this is what happened when enqueueing a net_buf with frags in a queue or linked list: 1.1 Before enqueueing: +--------+ +--------+ +--------+ |#1 node|\ |zephyrproject-rtos#2 node|\ |zephyrproject-rtos#3 node|\ | | \ | | \ | | \ | frags |------| frags |------| frags |------NULL +--------+ +--------+ +--------+ net_buf #1 has 2 fragments, net_bufs zephyrproject-rtos#2 and zephyrproject-rtos#3. Both the node and frags pointers (they are the same, since they are unioned) point to the next fragment. 1.2 After enqueueing: +--------+ +--------+ +--------+ +--------+ +--------+ |q/slist |------|#1 node|------|zephyrproject-rtos#2 node|------|zephyrproject-rtos#3 node|------|q/slist | |node | | *flag | / | *flag | / | | / |node | | | | frags |/ | frags |/ | frags |/ | | +--------+ +--------+ +--------+ +--------+ +--------+ When enqueing a net_buf (in this case #1) that contains fragments, the current net_buf implementation actually enqueues all the fragments (in this case zephyrproject-rtos#2 and zephyrproject-rtos#3) as actual queue/slist items, since node and frags are one and the same in memory. This makes the enqueuing operation expensive and it makes it impossible to atomically dequeue. The `*flag` notation here means that the `flags` member has been set to `NET_BUF_FRAGS` in order to be able to reconstruct the frags pointers when dequeuing. After this patch, the layout changes considerably: 2.1 Before enqueueing: +--------+ +--------+ +--------+ |#1 node|--NULL |zephyrproject-rtos#2 node|--NULL |zephyrproject-rtos#3 node|--NULL | | | | | | | frags |-------| frags |-------| frags |------NULL +--------+ +--------+ +--------+ This is very similar to 1.1, except that now node and frags are different pointers, so node is just set to NULL. 2.2 After enqueueing: +--------+ +--------+ +--------+ |q/slist |-------|#1 node|-------|q/slist | |node | | | |node | | | | frags | | | +--------+ +--------+ +--------+ | +--------+ +--------+ | |zephyrproject-rtos#2 node|--NULL |zephyrproject-rtos#3 node|--NULL | | | | | +------------| frags |-------| frags |------NULL +--------+ +--------+ When enqueuing net_buf #1, now we only enqueue that very item, instead of enqueing the frags as well, since now node and frags are separate pointers. This simplifies the operation and makes it atomic. Resolves zephyrproject-rtos#52718. Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Adjust the flash partitions for default Adafruit nRF52
Bootloader, enable UF2 build by default, and document
how to flash UF2 images to the device.
Signed-off-by: Peter Johanson peter@peterjohanson.com