Unable to flash mocked board
- Dominant language
- Python
- Stars
- 49
- Forks
- 32
- PR merge metrics
- No merged PRs in 30d
Description
### Description
I'm trying to flash a custom board based on the NUCLEO_H743ZI board using a NUCLEO_L476RG as a STLink. Everything works with mbed-cli, but not with mbed-tools. I mocked the platform using `mbedls --mock 0799:NUCLEO_H743ZI2`. mbed-tools compiles the code, but does not flash it. The error is:
```
ERROR: Could not identify a board with the product code: '0799'.
ERROR: No Mbed enabled devices found.
```
I figured out that mbed-tools does not detect the mocked board. On the other hand, mbed-cli does detect it:
```
[stelian@localhost anvil-v4]$ mbed detect
[mbed] Working path "/storage/work/anvil-v4" (program)
[mbed] WARNING: Missing Python modules were not auto-installed.
The Mbed OS tools in this program require the following Python modules: cbor
You can install all missing modules by running "pip install -r requirements.txt" in "/storage/work/anvil-v4/mbed-os"
On Posix systems (Linux, etc) you might have to switch to superuser account or use "sudo"
[mbed] Detected NUCLEO_H743ZI2, port /dev/ttyACM0, mounted /run/media/stelian/NODE_L476RG, interface version V2J28M17:
[mbed] Supported toolchains for NUCLEO_H743ZI2
| Target | mbed OS 2 | mbed OS 5 | ARM | uARM | GCC_ARM | IAR |
|----------------|-----------|-----------|-----------|------|-----------|-----------|
| NUCLEO_H743ZI2 | - | Supported | Supported | - | Supported | Supported |
Supported targets: 1
Supported toolchains: 3
[stelian@localhost anvil-v4]$ mbed-tools detect
ERROR: Could not identify a board with the product code: '0799'.
No connected Mbed devices found.
```
I would expect the same behavior as mbed-cli and I would expect the mocking functionality to work with mbed-tools as well.
### Tasks
- [ ] Find custom target to flash based on detect code
- [ ] Update custom targets documentation
- [ ] Code review
We should use the full list of boards (not just mbed-enabled ones) when picking what is elligible to flash to (when e.g. using `--flash`).
Contributor guide
Research direction
Start by reproducing the difference between `mbedls --mock 0799:NUCLEO_H743ZI2`, `mbed-tools detect`, and `mbed-tools --flash` using the NUCLEO_H743ZI2 and NUCLEO_L476RG setup described. Trace board selection from detection through flashing and review the custom-target documentation; done means the mocked board is recognized and eligible for flashing like it is with mbed-cli.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, embedded-iot
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100