Skip to content

Commit 5cee292

Browse files
authored
Update README.md
1 parent bf8d13f commit 5cee292

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

README.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
This port gives you a py-board-like experience using the BlackPill created by WeAct Studio.
1010

11-
There are 2 major versions of the BlackPills, they differ only in terms of crystal speed. A total of 6 versions of Firmware are provided, 3 for the 8MHz crystal version and 3 for the regular 25MHz crystal version. They differ only in the SPI flash size (0MB, 8MB and 16MB). All of them can be found in the `firmware` folder and they come in `.dfu` and `.hex` format. You can also define your own SPI flash size as described in the `How to build` section.
11+
There are 2 major versions of the BlackPills, they differ only in terms of crystal speed. A total of 6 versions of Firmware are provided, 3 for the 8MHz crystal version and 3 for the regular 25MHz crystal version. They differ only in the SPI flash size (0MB, 8MB and 16MB). All of them can be found in the `firmware` folder and they come in both `.dfu` and `.hex` format. You can also define your own SPI flash size as described in the `How to build` section.
1212

1313
The 8MHz version has the advantage to be more stable in terms of dfu-bootloader connectivity, as it tolerates a bigger margin of errors caused by ambient temperature.
1414

@@ -18,7 +18,7 @@ The pins/features-configurations are final, changes will only be done when force
1818

1919
## Pins definition
2020

21-
Things that in `()` are available in the pre-built firmware but they might interfere with other interfaces, so be caucious. These are only my choices, you may use any other pins, which were sated in the comment as `Valid`. For the 8MB version, the `SPI1` bus is used for SPI flash.
21+
Things that in `()` are available in the pre-built firmware but they might interfere with other interfaces, so be caucious. These are only my choices, you may use any other pins, which were stated in the comment as `Valid`. For the 8MB version, the `SPI1` bus is used for SPI flash.
2222

2323
| USART | USART1 | USART2 |(USART6)|
2424
| ------ | ------ | ------ | ------ |
@@ -43,9 +43,9 @@ Things that in `()` are available in the pre-built firmware but they might inter
4343

4444
## Lfs2 Support
4545

46-
`Lfs2` is a little fail-safe filesystem designed for microcontrollers that supports dynamic wear leveling, which is quiet useful when you are using the internal flash to log datas, since `FAT` does not have a wear leveling implementation and you will be wearing off your 10K cycles quiet fast.
46+
`Lfs2` is a little fail-safe filesystem designed for microcontrollers to support dynamic wear leveling, which is quiet useful when you are using the internal flash to log data. Since `FAT` does not have a wear leveling implementation, you will be wearing off your 10K cycles of the leading sectors quiet fast.
4747

48-
To format the filesystem to `Lfs2` you can simply excute the following code:
48+
To format the filesystem to `Lfs2`, you can simply excute the following code:
4949

5050
```python
5151
import os, pyb
@@ -88,8 +88,8 @@ os.chdir('/flash')
8888

8989
## Storage modification
9090

91-
### Flash layout
92-
If changing the flash layout is at your interest, you can modify the following section the `stm32f411.ld` file. However, there is this one rule: **never assign a sector of size more than your `FS_CACHE` size for `Flash_FS`.** Otherwise corruption will occur. This is caused by the fact that F4 series has very big sectors and every sector has to be erased before writting data to it. In case the `FS_CACHE` is not big enough to cache the biggest sector, when you are trying to write to the reset part of the sector, the sector itself will be erased but only part of its content was cached, as a result: you lost your uncached data and hence a corruption.
91+
### Flash layout (Only useful for the internal flash version)
92+
If changing the flash layout is at your interest, you can modify the following section in the `stm32f411.ld` file. However, there is this one rule: **never assign a sector of size more than your `FS_CACHE` size for `Flash_FS`.** Otherwise corruption will occur. This is caused by the fact that F4 series has very big sectors and every sector has to be erased before writting data to it. In case the `FS_CACHE` is not big enough to cache the biggest sector, when you are trying to write to the reset part of the sector, the sector itself will be erased but only part of its content was cached, as a result: you lost your uncached data and hence a corruption.
9393

9494
The default one is almost optimized for the RAM and flash ratio. The following are 2 suggestions/examples of working modifications:
9595

@@ -108,7 +108,7 @@ MEMORY
108108
}
109109
```
110110

111-
Example 2: Maximizing flash size. You are using sector 1, 2, 3 (each has 16K) and 4 (has 64K total) for your filesystem. This is the maximum amount of flash you can get at the cost of 128K firmware size and 64K of ram. This is the max amount, because for the next step you need 128K RAM, and you only have 128K RAM on the stm32f411ce. Also, the firmware is reduced by 128K because when you earse sector 5, the part of the firmware stored on it will also be removed, causing the system to fail.
111+
Example 2: Maximizing flash size. You are using sector 1, 2, 3 (each has 16K) and 4 (has 64K total) for your filesystem. This is the maximum amount of flash you can get at the cost of reducing maximum firmware size by 128K and 64K of ram. This is the max flash size, because for the next step you need 128K RAM, and you only have 128K RAM on the stm32f411ce. Also, the maximum firmware size is reduced by 128K because when you earse sector 5, the part of the firmware stored on it will also be removed, causing the system to fail.
112112
```ld
113113
MEMORY
114114
{
@@ -125,14 +125,15 @@ MEMORY
125125
Note that you have to wipe the whole flash during flashing the firmware for the modifications to take effect.
126126

127127
### Using external SPI-Flash
128-
You can either solder a external SPI-Flash directly on the board or connect the first SPI interface (`A4, A5, A6, A7`) to the external SPI-Flash module. Both way you can use the e.g. `8MB` version of firmware directly. Assuming your external SPI-Flash has `8MB` of storage.
128+
You can either solder a external SPI-Flash directly on the board or connect the first SPI interface (`A4, A5, A6, A7`) to the external SPI-Flash module. Both way you can use a e.g. `8MB` version of firmware directly. Assuming your external SPI-Flash has `8MB` of storage.
129129
If the SPI-Flash is not wired/soldered correctly, the firmware still boots but you do not have access to the flash storage.
130130

131131
## How to build
132132
### Vanilla
133-
First of all, you have to have a linux enviroment and get the compilers.
133+
First of all, you have to have a linux enviroment and get the compilers. On ubuntu 23.10 and above or debian 12 and above, it's called `gcc-arm-none-eabi`. On arch linux, it's called `arm-none-eabi-gcc`.
134134
```shell
135-
sudo apt-get -y install gcc-arm-none-eabi build-essential
135+
sudo apt-get -y install gcc-arm-none-eabi build-essential # On Ubuntu or Debian
136+
sudo pacman -S arm-none-eabi-gcc base-devel # On Arch Linux
136137
```
137138
After that, open the terminal and clone the official Micropython repo:
138139
```shell
@@ -225,3 +226,5 @@ In addtion to that, if you were using `STM32CubeProgrammer` with a GUI, everythi
225226
### Side note
226227

227228
If you were unlucky and got a clone/pirated board, you might find it difficult to flash the firmware using `dfu`. (`st-link` and `uart-bridge` works just fine.) You can try to connect `A10` to the `GND` pin before you booting the board into dfu. This might solve your issue.
229+
230+
If you know for a fact, that your boards are official, try to heat the board up with a hairdryer and try again. This should solve your problem.

0 commit comments

Comments
 (0)