I am new to DAPLink. Just know that it could turn a cortex m0 chip into a mbed Interface, then we could program or debug thought it. But I found that the mbed Interface has about 8MB USB Disk. How does it work? As we known, a mbed Interface chip(such as 11u24) has only 8KB RAM and 64KB Flash.
Asked
Active
Viewed 302 times
1 Answers
3
It does not actually have 8MB of space on the disk, the virtual file system just tells the operating system that it is 8MB large. This variable is held in vfs_user.c.
Then the virtual file system hijacks writes to the device and instead routes them to the target MCU through the Debug Access Port. So there is no caching on the chip that runs DAPLink, nor is there flash required. The files that show up when you mount the drive - like mbed.htm - are baked into ROM.

Jan Jongboom
- 26,598
- 9
- 83
- 120
-
Thanks for your answer. But I am still confused, if the vfs is just for our drap-n-drop, why does it show the actual flash size of the target MCU?(why it must be 4times larger?) And my another question – JerryYip Aug 10 '17 at 16:36
-
And could you explain the speed of Debug Access Port and USB? Is the speed of USB slower than DAP so that the .bin file will not store in cache of the mbed interface? – JerryYip Aug 10 '17 at 16:49
-
It does not have to be 4 times larger. It's a set variable, set to 4 times the largest flash that mbed supports. The most convenient to program a Cortex-M chip is via DAP, but it's a programmatic interface, so you need an external probe to talk to DAP. This can be via JLink or other debug probes, or integrated on the same board via DAPLink (there is also an external probe with DAPLink: the [SWDAP](https://developer.mbed.org/teams/mbed/wiki/SWDAP)). Re: speed, the USB device just delays write confirmation until it's written to DAP, so no (or little) caching needed. – Jan Jongboom Aug 11 '17 at 08:15