Skip to content

Commit

Permalink
tests/hwtest/main,adcs: Add update of boot count
Browse files Browse the repository at this point in the history
This commit updates the boot count stored in Data Storage during the
startup of the MAIN/ADCS Board.

Signed-off-by: Takuya Sasaki <takuya.sasaki@spacecubics.com>
  • Loading branch information
sasataku committed Oct 22, 2024
1 parent 24a30b1 commit d248d0c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/hwtest/adcs/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
#include "adcs_init.h"
#include "loop_test.h"
#include "syshk_test.h"
#include "data_nor.h"

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(adcs_main, CONFIG_SCSAT1_ADCS_LOG_LEVEL);

#define CMD_HANDLER_PRIO (0U)
#define CMD_EXEC_EVENT (1U)
#define BOOT_COUNT_FILE CONFIG_SC_LIB_FLASH_DATA_STORE_MNT_POINT "/boot.count"

char last_cmd[32];

Expand Down Expand Up @@ -133,12 +135,16 @@ int main(void)

printk("This is for HW test program for %s\n", CONFIG_BOARD);

datafs_init();

start_kick_wdt_thread();

sc_adcs_print_fpga_ids();

k_event_init(&exec_event);

update_boot_count(BOOT_COUNT_FILE);

ret = csp_enable();
if (ret < 0) {
LOG_ERR("Failed to enable the CSP. (%d)", ret);
Expand Down
6 changes: 6 additions & 0 deletions tests/hwtest/main/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@
#include "main_init.h"
#include "loop_test.h"
#include "syshk_test.h"
#include "data_nor.h"

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(main, CONFIG_SCSAT1_MAIN_LOG_LEVEL);

#define CMD_HANDLER_PRIO (0U)
#define CMD_EXEC_EVENT (1U)
#define BOOT_COUNT_FILE CONFIG_SC_LIB_FLASH_DATA_STORE_MNT_POINT "/boot.count"

char last_cmd[32];

Expand Down Expand Up @@ -139,12 +141,16 @@ int main(void)

printk("This is for HW test program for %s\n", CONFIG_BOARD);

datafs_init();

start_kick_wdt_thread();

sc_main_print_fpga_ids();

k_event_init(&exec_event);

update_boot_count(BOOT_COUNT_FILE);

ret = csp_enable();
if (ret < 0) {
LOG_ERR("Failed to enable the CSP. (%d)", ret);
Expand Down

0 comments on commit d248d0c

Please sign in to comment.