debug: coredump: flash backend: Switch FIXED_PARTITION_ macros
The commit switches flash area access from FLASH_AREA_ macros to FIXED_PARTITION_ macros and to usage of DTS node labels, to identify partitions, instead of label property. Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
This commit is contained in:
parent
0d956d2d31
commit
56663b4821
1 changed files with 6 additions and 6 deletions
|
@ -31,21 +31,21 @@ LOG_MODULE_REGISTER(coredump, CONFIG_KERNEL_LOG_LEVEL);
|
||||||
* function so that the first read of a data stream is always
|
* function so that the first read of a data stream is always
|
||||||
* aligned to flash write size.
|
* aligned to flash write size.
|
||||||
*/
|
*/
|
||||||
|
#define FLASH_PARTITION coredump_partition
|
||||||
|
#define FLASH_PARTITION_ID FIXED_PARTITION_ID(FLASH_PARTITION)
|
||||||
|
|
||||||
#if !FLASH_AREA_LABEL_EXISTS(coredump_partition)
|
#if !FIXED_PARTITION_EXISTS(FLASH_PARTITION)
|
||||||
#error "Need a fixed partition named 'coredump-partition'!"
|
#error "Need a fixed partition named 'coredump-partition'!"
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#define FLASH_CONTROLLER \
|
#define FLASH_CONTROLLER \
|
||||||
DT_PARENT(DT_PARENT(DT_NODELABEL(coredump_partition)))
|
DT_PARENT(DT_PARENT(DT_NODELABEL(FLASH_PARTITION)))
|
||||||
|
|
||||||
#define FLASH_WRITE_SIZE DT_PROP(FLASH_CONTROLLER, write_block_size)
|
#define FLASH_WRITE_SIZE DT_PROP(FLASH_CONTROLLER, write_block_size)
|
||||||
#define FLASH_BUF_SIZE FLASH_WRITE_SIZE
|
#define FLASH_BUF_SIZE FLASH_WRITE_SIZE
|
||||||
#define FLASH_ERASE_SIZE DT_PROP(FLASH_CONTROLLER, erase_block_size)
|
#define FLASH_ERASE_SIZE DT_PROP(FLASH_CONTROLLER, erase_block_size)
|
||||||
|
|
||||||
#define FLASH_PARTITION FLASH_AREA_ID(coredump_partition)
|
|
||||||
|
|
||||||
#define HDR_VER 1
|
#define HDR_VER 1
|
||||||
|
|
||||||
typedef int (*data_read_cb_t)(void *arg, uint8_t *buf, size_t len);
|
typedef int (*data_read_cb_t)(void *arg, uint8_t *buf, size_t len);
|
||||||
|
@ -106,7 +106,7 @@ static int partition_open(void)
|
||||||
|
|
||||||
(void)k_sem_take(&flash_sem, K_FOREVER);
|
(void)k_sem_take(&flash_sem, K_FOREVER);
|
||||||
|
|
||||||
ret = flash_area_open(FLASH_PARTITION, &backend_ctx.flash_area);
|
ret = flash_area_open(FLASH_PARTITION_ID, &backend_ctx.flash_area);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
LOG_ERR("Error opening flash partition for coredump!");
|
LOG_ERR("Error opening flash partition for coredump!");
|
||||||
|
|
||||||
|
@ -921,4 +921,4 @@ SHELL_CMD_REGISTER(coredump, &sub_coredump,
|
||||||
|
|
||||||
#endif /* CONFIG_DEBUG_COREDUMP_SHELL */
|
#endif /* CONFIG_DEBUG_COREDUMP_SHELL */
|
||||||
|
|
||||||
#endif /* FLASH_AREA_LABEL_EXISTS(coredump_partition) */
|
#endif /* FIXED_PARTITION_EXISTS(coredump_partition) */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue