Hi there,
I tried to build upy recently, it is really great! Amazing work.
After serial days hard work, I still have little idea about porting to a custom board, there are lots of boards can be refrenced though. Because not all of these boards support a particular feature, and don't know what to do about it, sometimes it is not there at all. I have made some modifications but not all of them because of lacking details.
There are confusing comments about some features too, e.g. :
#define MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE (0)
#define MICROPY_HW_HAS_FLASH (1)
MICROPY_HW_HAS_FLASH - somewhere saids internal flash, but it is much more like to be SPIFLASH here???
And something comes up suddenly in mpconfigboard.h:
#define MICROPY_HW_SPIFLASH_SIZE_BITS (128 * 1024 * 1024)
#define MICROPY_HW_SPIFLASH_CS (pin_E11)
#define MICROPY_HW_SPIFLASH_SCK (pin_E10)
#define MICROPY_HW_SPIFLASH_MOSI (pin_E12)
#define MICROPY_HW_SPIFLASH_MISO (pin_E13)
What are the patterns of these definitions: "MICROPY_HW_SPIFLASH_CS" ???
Well, it is ued by
const mp_spiflash_config_t spiflash_config = {
.bus_kind = MP_SPIFLASH_BUS_SPI,
.bus.u_spi.cs = MICROPY_HW_SPIFLASH_CS,
.bus.u_spi.data = (void*)&soft_spi_bus,
.bus.u_spi.proto = &mp_soft_spi_proto,
.cache = &spi_bdev_cache,
};
in bdev.c, but without #include "mpconfigboard.h", did I miss something?
And so on.
Honestly speaking, it drives me crazy sometimes.
So, where can i find a full list of the upy detailed features?
Where to find any docs about upy FULL FEATURE PORTING guides?
Re: Where to find any docs about upy FULL FEATURE PORTING guides?
I searched the stm32 C files for MICROPY_HW_HAS_FLASH and it only appears in one place:turoksama wrote: ↑Wed Apr 03, 2019 2:29 pmHi there,
I tried to build upy recently, it is really great! Amazing work.
After serial days hard work, I still have little idea about porting to a custom board, there are lots of boards can be refrenced though. Because not all of these boards support a particular feature, and don't know what to do about it, sometimes it is not there at all. I have made some modifications but not all of them because of lacking details.
There are confusing comments about some features too, e.g. :
#define MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE (0)
#define MICROPY_HW_HAS_FLASH (1)
MICROPY_HW_HAS_FLASH - somewhere saids internal flash, but it is much more like to be SPIFLASH here???
https://github.com/micropython/micropyt ... pyb.c#L193
which is a module for accessing the internal flash (not SPI Flash)
The new PYBD boards come with SPI Flash.turoksama wrote: ↑Wed Apr 03, 2019 2:29 pmAnd something comes up suddenly in mpconfigboard.h:
#define MICROPY_HW_SPIFLASH_SIZE_BITS (128 * 1024 * 1024)
#define MICROPY_HW_SPIFLASH_CS (pin_E11)
#define MICROPY_HW_SPIFLASH_SCK (pin_E10)
#define MICROPY_HW_SPIFLASH_MOSI (pin_E12)
#define MICROPY_HW_SPIFLASH_MISO (pin_E13)
What are the patterns of these definitions: "MICROPY_HW_SPIFLASH_CS" ???
Well, it is ued by
const mp_spiflash_config_t spiflash_config = {
.bus_kind = MP_SPIFLASH_BUS_SPI,
.bus.u_spi.cs = MICROPY_HW_SPIFLASH_CS,
.bus.u_spi.data = (void*)&soft_spi_bus,
.bus.u_spi.proto = &mp_soft_spi_proto,
.cache = &spi_bdev_cache,
};
in bdev.c, but without #include "mpconfigboard.h", did I miss something?
mpconfigboard.h is #included from ports/stm32/mpconfigport.h, which is in turn #included from py/mpconfig.h which is #included from py/obj.h which is included in flashbdev.h
You can do:
Code: Select all
make BOARD=PYBV11 build-PYBV11/flashbdev.pp
There is none. You need to examine the source code.
I normally start with the ports/stm32/boards/PYBV11/mpconfigboard.h file which tends to be fairly fully featured, so it includes most of the configuration settings. The PYBD board files (which haven't been merged into mainline yet) will have a few more features since it supports networking as well.
Re: Where to find any docs about upy FULL FEATURE PORTING guides?
Hi,
Great, thank you!
Where can i find PYBD port?
Great, thank you!
Where can i find PYBD port?
Re: Where to find any docs about upy FULL FEATURE PORTING guides?
Yep, I found it too.dhylands wrote: ↑Thu Apr 04, 2019 3:25 amSee this thread: https://github.com/micropython/micropython/pull/4669
I'll look into that.
Thanks!