-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
stm32: Add support for PYBD boards #4669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Because this function may execute in a raised priority context, and Python callbacks must execute at "thread" level.
Also supports auto-detection of USB interface, either HS or FS.
Also makes ap.config('essid') return str, not bytes (to be the same as other ports).
Also, if default WPA2 fails then WPA will be attempted automatically.
@@ -93,6 +96,7 @@ endif | |||
|
|||
LDFLAGS = -nostdlib -L $(LD_DIR) $(addprefix -T,$(LD_FILES)) -Map=$(@:.elf=.map) --cref | |||
LIBS = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name) | |||
LIBS += cyw43/libcyw43.a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason why this is a library and not as source?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of it is a binary blob that's downloaded to the CYW4343. The rest is a small bit of glue that talks to the CYW4343 through the SDMMC bus, and needs to be released as a binary to comply with the Cypress licensing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First I glad we have the binary version at least. Thanks to the authors. I would be nice to have the glue logic as source. Cypress has released an apace licensed version of WWD driver https://github.com/cypress/wwd. This has the glue logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the link to the Cypress repo, that's really great news that they have released it like that! So I think then we can make this glue logic open source. I will look into it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Damien George,
I am trying flash the mpy on PYBD-SF3-W4F2. I got the build successful and generated the *.dfu. But unable to get the board into DFU mode for flashing the image. Could please provide me a pointer on this?
Thanks for the help,
KVVD
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ Damien George,
Continuing my previous post. Steps followed to get the board into DFU mode:
- connect 3v3 pin with boot0 pin.
- Press reset button on the board
- Check if the device is listed using "dfu-tool watch" or "dfu-util -l".
But no luck. Empty list is printed on the screen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
http://micropython.org/download has the instructions for getting into the bootloader for the pybd.
The background here is that pybd uses its own bootloader (mboot) which has more features than the built-in ST bootloader (mainly it has the ability to write to external flash, so that the dfu file can flash both the on-chip flash as well as the external qspiflash). It's triggered by the process described above.
The likely reason the ST bootloader (which is what you're getting with the boot0 pin) isn't working for you is that it uses the other USB interface (which is accessible on the WBUS-DIP28 board), but either way you won't be able to flash a .dfu file built for the pybd using it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for the update. I am able to get the board into dfu mode.
// Disable IRQs so that the IRQ that wakes the device from stop mode is not | ||
// executed until after the clocks are reconfigured | ||
uint32_t irq_state = disable_irq(); | ||
|
||
#if defined(MICROPY_HW_QSPIFLASH_SIZE_BITS_LOG2) | ||
mp_spiflash_deepsleep(&spi_bdev.spiflash, 1); | ||
mp_spiflash_deepsleep(&spi_bdev2.spiflash, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assumes spi_bdev2
exists so will break on older board definitions that only have one spi flash defined
Sorry, something went wrong.
All reactions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. This needs to be configured better, at the moment it's just there so it works.
Sorry, something went wrong.
All reactions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 just a minor thing I saw, thought was worth noting as reminder for later! Looking fantastic in general though!
Sorry, something went wrong.
All reactions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, thanks. There are a few other things like this that need cleaning up, eg the fixes to QSPI and the MPU.
Sorry, something went wrong.
All reactions
QSPI MPU fixes were done in 8da39fd and caabdd9 As of commit 3581dee pretty much everything in this PR is now in master, in one form or another, in most cases cleaned up and improved. The only commit from here that is not in master is the one adding (via symlink) a bunch of networking modules as frozen bytecode 87a9e99 . Eventually this will be done but for now it's easy enough to just add needed scripts to the filesystem. |
All reactions
Sorry, something went wrong.
I just tried the master branch with a SF6 and SF2 module. At first glance, the only thing that is missing is support for the MMC. This little script fails, obviously at line 2:
|
All reactions
Sorry, something went wrong.
@robert-hh thanks for testing, indeed the MMC doesn't work with that snippet. What changed is that So this should work: machine.Pin('EN_3V3', machine.Pin.OUT, value=1)
os.mount(pyb.MMCard(), '/mmc') But I think what should be changed here is that EN_3V3 be automatically turned on if the MMCard object is initialised, because there's not much point in initialising it without power. |
All reactions
Sorry, something went wrong.
Thanks. That worked. |
All reactions
Sorry, something went wrong.
vsubbiah
andrewleech
jimmo
vs-pp
kvvd-packetp
Successfully merging this pull request may close these issues.
This PR adds support for PYBD_SF2, PYBD_SF3 and PYBD_SF6 boards, including a CYW4343 WiFi driver.
I don't intend to merge this just yet, it needs a little more cleaning of some commits and features, and some of the minor changes merged first.
Until it's fully merged I intend to rebase this PR, so please be aware of that if you clone it.