Skip to content
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

✨ (bootloader): Add ConfigKit - Write version, Read battery hysteresis offset #600

Merged
merged 2 commits into from
May 13, 2022

Conversation

YannLocatelli
Copy link
Member

@YannLocatelli YannLocatelli commented Mar 17, 2022


Spike: app/bootloader

Tests obligatoires

  • Ajouter les logs et vérifier que la valeur du fichier bootloader_battery_hysteresis_offset est bien celle lue dans la fonction batteryHysteresisOffset
  • Vérifier que le fichier bootloader_version a pour seul byte la valeur 0x01 avec Hex Fiend par exemple

Tests facultatifs

  • En l’absence d’un fichier bootloader_version, un nouveau est créé dans le dossier config
  • En l’asbence d’un fichier bootloader_battery_hysteresis_offset, un nouveau est créé dans le dossier config

@YannLocatelli YannLocatelli self-assigned this Mar 17, 2022
@codecov
Copy link

codecov bot commented Mar 17, 2022

Codecov Report

Merging #600 (b8df3a2) into develop (12ac758) will not change coverage.
The diff coverage is n/a.

❗ Current head b8df3a2 differs from pull request most recent head 9d41bef. Consider uploading reports for the commit 9d41bef to get more accurate results

@@           Coverage Diff            @@
##           develop     #600   +/-   ##
========================================
  Coverage    94.00%   94.00%           
========================================
  Files          115      115           
  Lines         2487     2487           
========================================
  Hits          2338     2338           
  Misses         149      149           

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@YannLocatelli
Copy link
Member Author

Suspended until feature to access SD configs (#598) is merged

@YannLocatelli YannLocatelli reopened this Apr 28, 2022
@YannLocatelli YannLocatelli force-pushed the yann/feature/bootloader/read-configuration-file branch from eb57c8a to 2124dd0 Compare April 29, 2022 10:41
@YannLocatelli YannLocatelli marked this pull request as ready for review April 29, 2022 10:41
@YannLocatelli YannLocatelli force-pushed the yann/feature/bootloader/read-configuration-file branch from 2124dd0 to e05a964 Compare April 29, 2022 10:44
@github-actions
Copy link

github-actions bot commented Apr 29, 2022

File comparision analysis report

🔖 Info

Target Flash Used (%) Flash Available (%) Static RAM (%)
bootloader 165596 (63%) 96548 (36%) 30512 (5%)
os 372524 (23%) 1192148 (76%) 79184 (15%)
Click to show memory sections
| -          |      Hex |     Bytes |  KiB |
|------------|---------:|----------:|-----:|
| Flash      | 0x200000 | 2 097 152 | 2048 |
| SRAM       |  0x80000 |   524 288 |  512 |
| Bootloader |  0x40000 |   262 144 |  256 |
| Header     |   0x1000 |     4 096 |    4 |
| OS         | 0x17E000 | 1 564 672 | 1528 |
| Tail       |   0x1000 |     4 096 |    4 |
| Scratch    |  0x40000 |   262 144 |  256 |

📝 Summary

Click to show summary
  • ✔️ - existing target
  • ✨ - new target
  • ⚰️ - deleted target
  • ✅ - files are the same
  • ❌ - files are different
Target Status .bin .map Total Flash (base/head) Total Flash Δ Static RAM (base/head) Static RAM Δ
LekaOS ✔️ 372524 (17%) ø 79184 (15%) ø
bootloader ✔️ 144668 (6%)
165596 (7%)
📈
20928 (14%)
30144 (5%)
30512 (5%)
📈
368 (1%)
certs_emc_ble_bt_lcd_led_motors ✔️ 257608 (12%) ø 35872 (6%) ø
certs_emc_ble_led_motors ✔️ 190960 (9%) ø 31512 (6%) ø
certs_emc_bt_lcd_qspi_rfid_touch_wifi ✔️ 164608 (7%) ø 29344 (5%) ø
certs_emc_lcd_led_motors ✔️ 91304 (4%) ø 16264 (3%) ø
hardware_motors_test_reduction_and_wheels ✔️ 193408 (9%) ø 30920 (5%) ø
spike_lk_behavior_kit ✔️ 194708 (9%) ø 54480 (10%) ø
spike_lk_ble ✔️ 233276 (11%) ø 34464 (6%) ø
spike_lk_bluetooth ✔️ 90616 (4%) ø 18016 (3%) ø
spike_lk_cg_animations ✔️ 152200 (7%) ø 53064 (10%) ø
spike_lk_color_kit ✔️ 88352 (4%) ø 20216 (3%) ø
spike_lk_command_kit ✔️ 199060 (9%) ø 57808 (11%) ø
spike_lk_config_kit ✔️ 136100 (6%) ø 20976 (4%) ø
spike_lk_coreled ✔️ 87916 (4%) ø 20104 (3%) ø
spike_lk_event_queue ✔️ 84088 (4%) ø 18744 (3%) ø
spike_lk_file_manager_kit ✔️ 143648 (6%) ø 21304 (4%) ø
spike_lk_file_reception ✔️ 331052 (15%) ø 34072 (6%) ø
spike_lk_flash_memory ✔️ 86712 (4%) ø 18056 (3%) ø
spike_lk_lcd ✔️ 167724 (7%) ø 53240 (10%) ø
spike_lk_led ✔️ 88168 (4%) ø 19872 (3%) ø
spike_lk_led_kit ✔️ 115420 (5%) ø 21008 (4%) ø
spike_lk_log_kit ✔️ 84440 (4%) ø 19248 (3%) ø
spike_lk_motors ✔️ 86008 (4%) ø 18088 (3%) ø
spike_lk_reinforcer ✔️ 111836 (5%) ø 21008 (4%) ø
spike_lk_rfid ✔️ 85208 (4%) ø 18032 (3%) ø
spike_lk_sensors_battery ✔️ 86960 (4%) ø 19120 (3%) ø
spike_lk_sensors_light ✔️ 83944 (4%) ø 18056 (3%) ø
spike_lk_sensors_microphone ✔️ 84696 (4%) ø 18056 (3%) ø
spike_lk_sensors_temperature_humidity ✔️ 90336 (4%) ø 18032 (3%) ø
spike_lk_sensors_touch ✔️ 91608 (4%) ø 18296 (3%) ø
spike_lk_serial_number ✔️ 82176 (3%) ø 18320 (3%) ø
spike_lk_ticker_timeout ✔️ 82584 (3%) ø 18072 (3%) ø
spike_lk_update_process_app_base ✔️ 144564 (6%) ø 21896 (4%) ø
spike_lk_update_process_app_update ✔️ 100328 (4%) ø 19080 (3%) ø
spike_lk_wifi ✔️ 130640 (6%) ø 21368 (4%) ø
spike_mbed_blinky ✔️ 57616 (2%) ø 11496 (2%) ø
spike_mbed_watchdog_ticker_vs_thread ✔️ 84112 (4%) ø 18920 (3%) ø
spike_stl_cxxsupport ✔️ 83424 (3%) ø 18144 (3%) ø

🗺️ Map files diff output

Click to show diff list
bootloader (click to expand)
--- build_artifacts/base_ref-build-enable_log_debug-ON/bootloader-map.txt	2022-05-13 14:09:30.048454436 +0000
+++ build_artifacts/head_ref-build-enable_log_debug-ON/bootloader-map.txt	2022-05-13 14:09:30.344454144 +0000
@@ -1,22 +1,23 @@
 | Module                 |           .text |       .data |          .bss |
 |------------------------|-----------------|-------------|---------------|
-| [fill]                 |       222(+222) |       0(+0) |       52(+52) |
+| [fill]                 |       170(+170) |       8(+8) |       59(+59) |
+| [lib]/ConfigKit.a      |       328(+328) |       0(+0) |         0(+0) |
 | [lib]/CoreBattery.a    |       472(+472) |       0(+0) |         0(+0) |
 | [lib]/CoreMotor.a      |       130(+130) |       0(+0) |         0(+0) |
 | [lib]/CorePwm.a        |         12(+12) |       0(+0) |         0(+0) |
 | [lib]/CoreSPI.a        |         28(+28) |       0(+0) |         0(+0) |
-| [lib]/FileManagerKit.a |       768(+768) |       0(+0) |         0(+0) |
+| [lib]/FileManagerKit.a |       772(+772) |       0(+0) |         0(+0) |
 | [lib]/bootutil.a       |     5898(+5898) |     16(+16) | 13816(+13816) |
-| [lib]/c.a              |   41256(+41256) | 2572(+2572) |       97(+97) |
-| [lib]/gcc.a            |     3340(+3340) |       0(+0) |         0(+0) |
-| [lib]/mbed-os-static.a |   75118(+75118) |   528(+528) | 11083(+11083) |
+| [lib]/c.a              |   42256(+42256) | 2572(+2572) |       97(+97) |
+| [lib]/gcc.a            |     7148(+7148) |       0(+0) |         0(+0) |
+| [lib]/mbed-os-static.a |   75142(+75142) |   528(+528) | 11083(+11083) |
 | [lib]/misc             |       188(+188) |       4(+4) |       28(+28) |
 | [lib]/nosys.a          |         32(+32) |       0(+0) |         0(+0) |
-| [lib]/stdc++.a         |           0(+0) |       0(+0) |         0(+0) |
+| [lib]/stdc++.a         |   10968(+10968) |     16(+16) |     204(+204) |
 | default_bd.cpp.obj     |       242(+242) |       0(+0) |     568(+568) |
-| main.cpp.obj           |     2874(+2874) |       0(+0) |   1092(+1092) |
+| main.cpp.obj           |     3294(+3294) |       0(+0) |   1201(+1201) |
 | signing_keys.c.obj     |           0(+0) |       0(+0) |         0(+0) |
-| Subtotals              | 130580(+130580) | 3120(+3120) | 26736(+26736) |
-Total Static RAM memory (data + bss): 29856(+29856) bytes
-Total Flash memory (text + data): 133700(+133700) bytes
+| Subtotals              | 147080(+147080) | 3144(+3144) | 27056(+27056) |
+Total Static RAM memory (data + bss): 30200(+30200) bytes
+Total Flash memory (text + data): 150224(+150224) bytes
 
Flash used: 165596 (7%) / total: 2097152
SRAM used: 30512 (5%) / total: 524288

@github-actions
Copy link

github-actions bot commented Apr 29, 2022

File comparision analysis report

🔖 Info

Target Flash Used (%) Flash Available (%) Static RAM (%)
bootloader 166236 (63%) 95908 (36%) 30416 (5%)
os 350048 (22%) 1214624 (77%) 72128 (13%)
Click to show memory sections
| -          |      Hex |     Bytes |  KiB |
|------------|---------:|----------:|-----:|
| Flash      | 0x200000 | 2 097 152 | 2048 |
| SRAM       |  0x80000 |   524 288 |  512 |
| Bootloader |  0x40000 |   262 144 |  256 |
| Header     |   0x1000 |     4 096 |    4 |
| OS         | 0x17E000 | 1 564 672 | 1528 |
| Tail       |   0x1000 |     4 096 |    4 |
| Scratch    |  0x40000 |   262 144 |  256 |

📝 Summary

Click to show summary
  • ✔️ - existing target
  • ✨ - new target
  • ⚰️ - deleted target
  • ✅ - files are the same
  • ❌ - files are different
Target Status .bin .map Total Flash (base/head) Total Flash Δ Static RAM (base/head) Static RAM Δ
LekaOS ✔️ 350048 (16%) ø 72128 (13%) ø
bootloader ✔️ 145308 (6%)
166236 (7%)
📈
20928 (14%)
30048 (5%)
30416 (5%)
📈
368 (1%)
certs_emc_ble_bt_lcd_led_motors ✔️ 250704 (11%) ø 29240 (5%) ø
certs_emc_ble_led_motors ✔️ 174584 (8%) ø 24952 (4%) ø
certs_emc_bt_lcd_qspi_rfid_touch_wifi ✔️ 148840 (7%) ø 22528 (4%) ø
certs_emc_lcd_led_motors ✔️ 92008 (4%) ø 16168 (3%) ø
hardware_motors_test_reduction_and_wheels ✔️ 177976 (8%) ø 24360 (4%) ø
spike_lk_behavior_kit ✔️ 186060 (8%) ø 48064 (9%) ø
spike_lk_ble ✔️ 225248 (10%) ø 27808 (5%) ø
spike_lk_bluetooth ✔️ 73256 (3%) ø 11448 (2%) ø
spike_lk_cg_animations ✔️ 144632 (6%) ø 46528 (8%) ø
spike_lk_color_kit ✔️ 65712 (3%) ø 13744 (2%) ø
spike_lk_command_kit ✔️ 188864 (9%) ø 50880 (9%) ø
spike_lk_config_kit ✔️ 124204 (5%) ø 14312 (2%) ø
spike_lk_coreled ✔️ 76164 (3%) ø 13688 (2%) ø
spike_lk_event_queue ✔️ 74736 (3%) ø 12072 (2%) ø
spike_lk_file_manager_kit ✔️ 128680 (6%) ø 14384 (2%) ø
spike_lk_file_reception ✔️ 326984 (15%) ø 27576 (5%) ø
spike_lk_flash_memory ✔️ 63880 (3%) ø 11448 (2%) ø
spike_lk_lcd ✔️ 158108 (7%) ø 46568 (8%) ø
spike_lk_led ✔️ 65744 (3%) ø 13392 (2%) ø
spike_lk_led_kit ✔️ 103460 (4%) ø 14592 (2%) ø
spike_lk_log_kit ✔️ 63736 (3%) ø 12256 (2%) ø
spike_lk_motors ✔️ 62600 (2%) ø 11488 (2%) ø
spike_lk_reinforcer ✔️ 102620 (4%) ø 14592 (2%) ø
spike_lk_rfid ✔️ 78580 (3%) ø 11504 (2%) ø
spike_lk_sensors_battery ✔️ 78196 (3%) ø 12568 (2%) ø
spike_lk_sensors_light ✔️ 60056 (2%) ø 11440 (2%) ø
spike_lk_sensors_microphone ✔️ 72496 (3%) ø 11504 (2%) ø
spike_lk_sensors_temperature_humidity ✔️ 67048 (3%) ø 11424 (2%) ø
spike_lk_sensors_touch ✔️ 68600 (3%) ø 11432 (2%) ø
spike_lk_serial_number ✔️ 58904 (2%) ø 11464 (2%) ø
spike_lk_ticker_timeout ✔️ 69052 (3%) ø 11632 (2%) ø
spike_lk_update_process_app_base ✔️ 122788 (5%) ø 15288 (2%) ø
spike_lk_update_process_app_update ✔️ 77632 (3%) ø 12352 (2%) ø
spike_lk_wifi ✔️ 116392 (5%) ø 14808 (2%) ø
spike_mbed_blinky ✔️ 57968 (2%) ø 11400 (2%) ø
spike_mbed_watchdog_ticker_vs_thread ✔️ 63208 (3%) ø 12448 (2%) ø
spike_stl_cxxsupport ✔️ 58456 (2%) ø 11400 (2%) ø

🗺️ Map files diff output

Click to show diff list
bootloader (click to expand)
--- build_artifacts/base_ref-build-enable_log_debug-OFF/bootloader-map.txt	2022-05-13 14:08:21.426845403 +0000
+++ build_artifacts/head_ref-build-enable_log_debug-OFF/bootloader-map.txt	2022-05-13 14:08:21.642847127 +0000
@@ -1,22 +1,23 @@
 | Module                 |           .text |       .data |          .bss |
 |------------------------|-----------------|-------------|---------------|
-| [fill]                 |       214(+214) |       0(+0) |       44(+44) |
+| [fill]                 |       162(+162) |       8(+8) |       51(+51) |
+| [lib]/ConfigKit.a      |       328(+328) |       0(+0) |         0(+0) |
 | [lib]/CoreBattery.a    |       472(+472) |       0(+0) |         0(+0) |
 | [lib]/CoreMotor.a      |       130(+130) |       0(+0) |         0(+0) |
 | [lib]/CorePwm.a        |         12(+12) |       0(+0) |         0(+0) |
 | [lib]/CoreSPI.a        |         28(+28) |       0(+0) |         0(+0) |
-| [lib]/FileManagerKit.a |       768(+768) |       0(+0) |         0(+0) |
+| [lib]/FileManagerKit.a |       772(+772) |       0(+0) |         0(+0) |
 | [lib]/bootutil.a       |     5898(+5898) |     16(+16) | 13816(+13816) |
-| [lib]/c.a              |   42360(+42360) | 2572(+2572) |       97(+97) |
-| [lib]/gcc.a            |     3340(+3340) |       0(+0) |         0(+0) |
-| [lib]/mbed-os-static.a |   74662(+74662) |   528(+528) | 10995(+10995) |
+| [lib]/c.a              |   43360(+43360) | 2572(+2572) |       97(+97) |
+| [lib]/gcc.a            |     7148(+7148) |       0(+0) |         0(+0) |
+| [lib]/mbed-os-static.a |   74686(+74686) |   528(+528) | 10995(+10995) |
 | [lib]/misc             |       188(+188) |       4(+4) |       28(+28) |
 | [lib]/nosys.a          |         32(+32) |       0(+0) |         0(+0) |
-| [lib]/stdc++.a         |           0(+0) |       0(+0) |         0(+0) |
+| [lib]/stdc++.a         |   10968(+10968) |     16(+16) |     204(+204) |
 | default_bd.cpp.obj     |       242(+242) |       0(+0) |     568(+568) |
-| main.cpp.obj           |     2874(+2874) |       0(+0) |   1092(+1092) |
+| main.cpp.obj           |     3294(+3294) |       0(+0) |   1201(+1201) |
 | signing_keys.c.obj     |           0(+0) |       0(+0) |         0(+0) |
-| Subtotals              | 131220(+131220) | 3120(+3120) | 26640(+26640) |
-Total Static RAM memory (data + bss): 29760(+29760) bytes
-Total Flash memory (text + data): 134340(+134340) bytes
+| Subtotals              | 147720(+147720) | 3144(+3144) | 26960(+26960) |
+Total Static RAM memory (data + bss): 30104(+30104) bytes
+Total Flash memory (text + data): 150864(+150864) bytes
 
Flash used: 166236 (7%) / total: 2097152
SRAM used: 30416 (5%) / total: 524288

@YannLocatelli YannLocatelli linked an issue Apr 29, 2022 that may be closed by this pull request
@YannLocatelli YannLocatelli force-pushed the yann/feature/bootloader/read-configuration-file branch from e05a964 to 6fad658 Compare April 29, 2022 11:09
@YannLocatelli YannLocatelli changed the title ✨ (bootloader): Add ConfigKit - Write version, Read battery … ✨ (bootloader): Add ConfigKit - Write version, Read battery hysteresis offset Apr 29, 2022
@YannLocatelli YannLocatelli force-pushed the yann/feature/bootloader/read-configuration-file branch from 6fad658 to af4a731 Compare April 29, 2022 14:20
Copy link
Member Author

@YannLocatelli YannLocatelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filesystem renaming

app/bootloader/main.cpp Show resolved Hide resolved
app/bootloader/main.cpp Show resolved Hide resolved
Copy link
Member

@ladislas ladislas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@ladislas ladislas force-pushed the yann/feature/bootloader/read-configuration-file branch from af4a731 to da5bf7c Compare May 6, 2022 14:30
@ladislas ladislas mentioned this pull request May 7, 2022
24 tasks
Copy link
Member

@ladislas ladislas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2nd review - tout me semble bon mais j'ai une question à propos du fait d'écrire la version du bootloader à chaque démarrage, ça me semble étrange.

app/bootloader/main.cpp Show resolved Hide resolved
@ladislas ladislas force-pushed the yann/feature/bootloader/read-configuration-file branch from da5bf7c to 1a04278 Compare May 7, 2022 21:07
@YannLocatelli YannLocatelli force-pushed the yann/feature/bootloader/read-configuration-file branch from 1a04278 to b8df3a2 Compare May 13, 2022 11:47
@ladislas ladislas force-pushed the yann/feature/bootloader/read-configuration-file branch from b8df3a2 to 9d41bef Compare May 13, 2022 13:58
@ladislas ladislas merged commit 148f0dc into develop May 13, 2022
@ladislas ladislas deleted the yann/feature/bootloader/read-configuration-file branch May 13, 2022 13:59
@sonarcloud
Copy link

sonarcloud bot commented May 13, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bootloader - Set hysteresis value from config file
2 participants