ARMmbed / DAPLink

https://daplink.io
Apache License 2.0
2.31k stars 974 forks source link

macOS 15 Sequoia USB drive name shows as `NO NAME` #1082

Open microbit-carlos opened 2 hours ago

microbit-carlos commented 2 hours ago

This has been reported with the micro:bit V2.00 and V2.21, using DAPLink 0255 to 0258.

image
image
image

This problem is not present for micro:bit V1, where the USB drive name is still MICROBIT, tested with DAPLink 0249, 0254 and 0258.

microbit-carlos commented 1 hour ago

The V1 device name contains 3 spaces at the end MICROBIT(11 characters in total): https://github.com/ARMmbed/DAPLink/blob/82dc31d09456710ad0610db5b0ee2a73282f6acc/source/board/microbit.c#L78

And V2 does not have the spaces present: https://github.com/ARMmbed/DAPLink/blob/82dc31d09456710ad0610db5b0ee2a73282f6acc/source/board/microbitv2/microbitv2.c#L475

Switching the strings between the V1 and V2, and testing the builds in macOS and we can confirm that the issue seems to be related to the spaces.

There are a few more cases of other ports where spaces have been added until the 11th character (and some where a shorter than 11 characters name doesn't have spaces either), and haven't found a drive name with more than 11 characters. So maybe the standard specifies it needs to be 11 characters exactly? A bit odd that this has never been an issue anywhere else before.

mathias-arm commented 1 hour ago

The structure is 11 bytes long. The difference between the two is that if you dont pad with spaces you will end up with \0 values in the name. I guess Sequoia is more defensive on how it handles this.