Merge pull request #120 from ryanplusplus/transfert-typo
Fixed typo (Transfert -> Transfer)
This commit is contained in:
commit
b50e222e2e
|
@ -3,7 +3,7 @@ The [bootloader](https://github.com/lupyuen/pinetime-rust-mynewt/tree/master/lib
|
||||||
|
|
||||||
The goal of this project is to provide a common bootloader for multiple (all?) Pinetime projects. It allows to upgrade the current bootloader and even replace the current application by another one that supports the same bootloader.
|
The goal of this project is to provide a common bootloader for multiple (all?) Pinetime projects. It allows to upgrade the current bootloader and even replace the current application by another one that supports the same bootloader.
|
||||||
|
|
||||||
As we wanted this bootloader to be as universal as possible, we decided that it should **not** integrate a BLE stack and provide OTA capabilities.
|
As we wanted this bootloader to be as universal as possible, we decided that it should **not** integrate a BLE stack and provide OTA capabilities.
|
||||||
|
|
||||||
Integrating a BLE stack for the OTA functionality would have used to much memory space and/or forced all the firmware developers to use the same BLE stack as the bootloader.
|
Integrating a BLE stack for the OTA functionality would have used to much memory space and/or forced all the firmware developers to use the same BLE stack as the bootloader.
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ MCUBoot is run at boot time. In normal operation, it just jumps to the reset han
|
||||||
|
|
||||||
But MCUBoot does much more than that : it can upgrade the firmware that is currently running by a new one, and it is also able to revert to the previous version of the firmware in case the new one does not run propertly.
|
But MCUBoot does much more than that : it can upgrade the firmware that is currently running by a new one, and it is also able to revert to the previous version of the firmware in case the new one does not run propertly.
|
||||||
|
|
||||||
To do this, it uses 2 memory 'slots' :
|
To do this, it uses 2 memory 'slots' :
|
||||||
- **The primary slot** : it contains the current firmware, the one that will be executed by MCUBoot
|
- **The primary slot** : it contains the current firmware, the one that will be executed by MCUBoot
|
||||||
- **The secondary slot** : it is used to store the upgraded version of the firmware, when available.
|
- **The secondary slot** : it is used to store the upgraded version of the firmware, when available.
|
||||||
|
|
||||||
|
@ -37,13 +37,13 @@ Note than MCUBoot **does not** provide any means to download and store the new v
|
||||||
# Degraded cases
|
# Degraded cases
|
||||||
This chapter describes degraded cases that are handled by our bootloader and those that are not supported.
|
This chapter describes degraded cases that are handled by our bootloader and those that are not supported.
|
||||||
|
|
||||||
Case | Current bootloader | Solution
|
Case | Current bootloader | Solution
|
||||||
-----|--------------------|----------------------------------------------
|
-----|--------------------|----------------------------------------------
|
||||||
Data got corrupted during file transfert | [OK] Application firmware does a CRC check before applying the update, and does not proceed if it fails. | N/A
|
Data got corrupted during file transfer | [OK] Application firmware does a CRC check before applying the update, and does not proceed if it fails. | N/A
|
||||||
New firmware does not run at all (bad file) (1) | [NOK] MCU executes unknown instructions and will most likely end up in an infinite loop or freeze in an error handler. The bootloader does not run, it can do nothing, the MCU is stucked until next reset | [OK] The bootloader starts the watchdog just before running the new firmware. This way, the watchdog will reset the MCU after ~7s because the firmware does not refresh it. Bootloader reverts to the previous version of the firmware during the reset.
|
New firmware does not run at all (bad file) (1) | [NOK] MCU executes unknown instructions and will most likely end up in an infinite loop or freeze in an error handler. The bootloader does not run, it can do nothing, the MCU is stucked until next reset | [OK] The bootloader starts the watchdog just before running the new firmware. This way, the watchdog will reset the MCU after ~7s because the firmware does not refresh it. Bootloader reverts to the previous version of the firmware during the reset.
|
||||||
New firmware runs, does not set the valid bit and does not refresh the watchdog | [NOK] The new firmware runs until the next reset. The bootloader will be able to revert to the previous firmware only during the next reset. If the new firmware does not run properly and does not reset, the bootloader can do nothing until the next reset | [OK] The bootloader starts the watchdog just before running the new firmware. This way, the watchdog will reset the MCU after ~7s because the firmware does not refresh it. Bootloader reverts to the previous version of the firmware during the reset.
|
New firmware runs, does not set the valid bit and does not refresh the watchdog | [NOK] The new firmware runs until the next reset. The bootloader will be able to revert to the previous firmware only during the next reset. If the new firmware does not run properly and does not reset, the bootloader can do nothing until the next reset | [OK] The bootloader starts the watchdog just before running the new firmware. This way, the watchdog will reset the MCU after ~7s because the firmware does not refresh it. Bootloader reverts to the previous version of the firmware during the reset.
|
||||||
New firmware does not run properly, does not set the valid bit but refreshes the watchdog | [NOK] The bootloader will be able to revert to the previous firmware only during the next reset. If the new firmware does not run properly and does not reset, the bootloader can do nothing until the next reset | [~] Wait for the battery to drain. The CPU will reset the next time the device is charged and will be able to rollback to the previous version.
|
New firmware does not run properly, does not set the valid bit but refreshes the watchdog | [NOK] The bootloader will be able to revert to the previous firmware only during the next reset. If the new firmware does not run properly and does not reset, the bootloader can do nothing until the next reset | [~] Wait for the battery to drain. The CPU will reset the next time the device is charged and will be able to rollback to the previous version.
|
||||||
New firmware does not run properly but sets the valid bit and refreshes the watchdog | [NOK] The bootloader won't revert to the previous version because the valid flag is set | [~] Wait for the battery to drain. The CPU will reset the next time the device is charged. Then, the bootloader must provide a way for the user to force the rollback to the previous version
|
New firmware does not run properly but sets the valid bit and refreshes the watchdog | [NOK] The bootloader won't revert to the previous version because the valid flag is set | [~] Wait for the battery to drain. The CPU will reset the next time the device is charged. Then, the bootloader must provide a way for the user to force the rollback to the previous version
|
||||||
|
|
||||||
*(1) I've observed this when I tried to run a firmware built to run from offset 0 while it was flashed at offset 0x8000 in memory (bad vector table).*
|
*(1) I've observed this when I tried to run a firmware built to run from offset 0 while it was flashed at offset 0x8000 in memory (bad vector table).*
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ The SPI Flash memory is not accessible via the SWD debugger. Use the firmware 'p
|
||||||
$ make pinetime-graphics
|
$ make pinetime-graphics
|
||||||
```
|
```
|
||||||
|
|
||||||
- Program (using OpenOCD for example) :
|
- Program (using OpenOCD for example) :
|
||||||
```
|
```
|
||||||
program pinetime-graphics.bin 0
|
program pinetime-graphics.bin 0
|
||||||
```
|
```
|
||||||
|
@ -84,7 +84,7 @@ Build the binary compatible with the booloader:
|
||||||
make pinetime-mcuboot-app
|
make pinetime-mcuboot-app
|
||||||
`
|
`
|
||||||
|
|
||||||
The binary is located in *<build directory>/src/pinetime-mcuboot-app.bin*.
|
The binary is located in *<build directory>/src/pinetime-mcuboot-app.bin*.
|
||||||
|
|
||||||
It must me converted into a MCUBoot image using *imgtool.py* from [MCUBoot](https://github.com/JuulLabs-OSS/mcuboot/tree/master/scripts). Simply checkout the project and run the script <mcuboot root>/scripts/imgtool.py with the following command line:
|
It must me converted into a MCUBoot image using *imgtool.py* from [MCUBoot](https://github.com/JuulLabs-OSS/mcuboot/tree/master/scripts). Simply checkout the project and run the script <mcuboot root>/scripts/imgtool.py with the following command line:
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ void Gfx::ClearScreen() {
|
||||||
|
|
||||||
lcd.BeginDrawBuffer(0, 0, width, height);
|
lcd.BeginDrawBuffer(0, 0, width, height);
|
||||||
lcd.NextDrawBuffer(reinterpret_cast<const uint8_t *>(buffer), width * 2);
|
lcd.NextDrawBuffer(reinterpret_cast<const uint8_t *>(buffer), width * 2);
|
||||||
WaitTransfertFinished();
|
WaitTransferFinished();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ void Gfx::FillRectangle(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint16_t col
|
||||||
lcd.BeginDrawBuffer(x, y, w, h);
|
lcd.BeginDrawBuffer(x, y, w, h);
|
||||||
lcd.NextDrawBuffer(reinterpret_cast<const uint8_t *>(buffer), width * 2);
|
lcd.NextDrawBuffer(reinterpret_cast<const uint8_t *>(buffer), width * 2);
|
||||||
|
|
||||||
WaitTransfertFinished();
|
WaitTransferFinished();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gfx::FillRectangle(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t* b) {
|
void Gfx::FillRectangle(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t* b) {
|
||||||
|
@ -54,7 +54,7 @@ void Gfx::FillRectangle(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t* b)
|
||||||
lcd.BeginDrawBuffer(x, y, w, h);
|
lcd.BeginDrawBuffer(x, y, w, h);
|
||||||
lcd.NextDrawBuffer(reinterpret_cast<const uint8_t *>(b), width * 2);
|
lcd.NextDrawBuffer(reinterpret_cast<const uint8_t *>(b), width * 2);
|
||||||
|
|
||||||
WaitTransfertFinished();
|
WaitTransferFinished();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gfx::DrawString(uint8_t x, uint8_t y, uint16_t color, const char *text, const FONT_INFO *p_font, bool wrap) {
|
void Gfx::DrawString(uint8_t x, uint8_t y, uint16_t color, const char *text, const FONT_INFO *p_font, bool wrap) {
|
||||||
|
@ -125,7 +125,7 @@ void Gfx::DrawChar(const FONT_INFO *font, uint8_t c, uint8_t *x, uint8_t y, uint
|
||||||
|
|
||||||
lcd.BeginDrawBuffer(*x, y, bytes_in_line*8, font->height);
|
lcd.BeginDrawBuffer(*x, y, bytes_in_line*8, font->height);
|
||||||
lcd.NextDrawBuffer(reinterpret_cast<const uint8_t *>(&buffer), bytes_in_line*8*2);
|
lcd.NextDrawBuffer(reinterpret_cast<const uint8_t *>(&buffer), bytes_in_line*8*2);
|
||||||
WaitTransfertFinished();
|
WaitTransferFinished();
|
||||||
|
|
||||||
*x += font->charInfo[char_idx].widthBits + font->spacePixels;
|
*x += font->charInfo[char_idx].widthBits + font->spacePixels;
|
||||||
}
|
}
|
||||||
|
@ -153,7 +153,7 @@ bool Gfx::GetNextBuffer(uint8_t **data, size_t &size) {
|
||||||
state.remainingIterations--;
|
state.remainingIterations--;
|
||||||
if (state.remainingIterations == 0) {
|
if (state.remainingIterations == 0) {
|
||||||
state.busy = false;
|
state.busy = false;
|
||||||
NotifyEndOfTransfert(state.taskToNotify);
|
NotifyEndOfTransfer(state.taskToNotify);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,7 +185,7 @@ bool Gfx::GetNextBuffer(uint8_t **data, size_t &size) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gfx::NotifyEndOfTransfert(TaskHandle_t task) {
|
void Gfx::NotifyEndOfTransfer(TaskHandle_t task) {
|
||||||
if(task != nullptr) {
|
if(task != nullptr) {
|
||||||
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
|
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
|
||||||
vTaskNotifyGiveFromISR(task, &xHigherPriorityTaskWoken);
|
vTaskNotifyGiveFromISR(task, &xHigherPriorityTaskWoken);
|
||||||
|
@ -193,7 +193,7 @@ void Gfx::NotifyEndOfTransfert(TaskHandle_t task) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gfx::WaitTransfertFinished() const {
|
void Gfx::WaitTransferFinished() const {
|
||||||
ulTaskNotifyTake(pdTRUE, 500);
|
ulTaskNotifyTake(pdTRUE, 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,4 +204,3 @@ void Gfx::SetScrollArea(uint16_t topFixedLines, uint16_t scrollLines, uint16_t b
|
||||||
void Gfx::SetScrollStartLine(uint16_t line) {
|
void Gfx::SetScrollStartLine(uint16_t line) {
|
||||||
lcd.VerticalScrollStartAddress(line);
|
lcd.VerticalScrollStartAddress(line);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,8 +53,8 @@ namespace Pinetime {
|
||||||
Drivers::St7789& lcd;
|
Drivers::St7789& lcd;
|
||||||
|
|
||||||
void SetBackgroundColor(uint16_t color);
|
void SetBackgroundColor(uint16_t color);
|
||||||
void WaitTransfertFinished() const;
|
void WaitTransferFinished() const;
|
||||||
void NotifyEndOfTransfert(TaskHandle_t task);
|
void NotifyEndOfTransfer(TaskHandle_t task);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,8 +76,8 @@ void LittleVgl::SetFullRefresh(FullRefreshDirections direction) {
|
||||||
|
|
||||||
void LittleVgl::FlushDisplay(const lv_area_t *area, lv_color_t *color_p) {
|
void LittleVgl::FlushDisplay(const lv_area_t *area, lv_color_t *color_p) {
|
||||||
ulTaskNotifyTake(pdTRUE, 500);
|
ulTaskNotifyTake(pdTRUE, 500);
|
||||||
// NOtification is still needed (even if there is a mutex on SPI) because of the DataCommand pin
|
// Notification is still needed (even if there is a mutex on SPI) because of the DataCommand pin
|
||||||
// which cannot be set/clear during a transfert.
|
// which cannot be set/clear during a transfer.
|
||||||
|
|
||||||
|
|
||||||
// TODO refactore and remove duplicated code
|
// TODO refactore and remove duplicated code
|
||||||
|
@ -831,6 +831,3 @@ void LittleVgl::InitThemeWindow() {
|
||||||
// theme.style.win.btn.rel = &lv_style_transp;
|
// theme.style.win.btn.rel = &lv_style_transp;
|
||||||
// theme.style.win.btn.pr = &win_btn_pr;
|
// theme.style.win.btn.pr = &win_btn_pr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user