From ca8986933a4a96f8413c343094210d1d0abd9aef Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Thu, 14 Nov 2024 10:31:50 +0100 Subject: [PATCH] drv/upgate: projects: fix build warning with ses 8.18 --- drv/upgate/upgate.c | 12 ++++++------ projects/01bsp_nvmc/01bsp_nvmc.c | 2 +- projects/03app_log_dump/main.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drv/upgate/upgate.c b/drv/upgate/upgate.c index 629fdedf2..ebc1dedce 100644 --- a/drv/upgate/upgate.c +++ b/drv/upgate/upgate.c @@ -73,13 +73,13 @@ void db_upgate_start(void) { printf("Sectors to erase: %u\n", sector_count); for (uint32_t sector = 0; sector < sector_count; sector++) { uint32_t addr = _upgate_vars.addr + sector * N25Q128_SECTOR_SIZE; - printf("Erasing sector %u at %p\n", sector, addr); + printf("Erasing sector %u at %p\n", sector, (uint32_t *)addr); n25q128_sector_erase(addr); } puts(""); uzlib_init(); _upgate_vars.last_packet_acked = UINT32_MAX; - printf("Starting upgate at %p\n\n", _upgate_vars.addr); + printf("Starting upgate at %p\n\n", (uint32_t *)_upgate_vars.addr); } void db_upgate_finish(void) { @@ -101,12 +101,12 @@ void db_upgate_finish(void) { for (uint32_t sector = 0; sector < sector_count; sector++) { uint32_t addr = _upgate_vars.base_addr + sector * N25Q128_SECTOR_SIZE; - printf("Erasing sector %u at %p\n", sector, addr); + printf("Erasing sector %u at %p\n", sector, (uint32_t *)addr); n25q128_sector_erase(addr); } // Copy and verify the content. for (uint32_t block = 0; block < _upgate_vars.bistream_size / N25Q128_PAGE_SIZE; block++) { - printf("Moving %d bytes from %p to %p\n", N25Q128_PAGE_SIZE, _upgate_vars.addr + block * N25Q128_PAGE_SIZE, _upgate_vars.base_addr + block * N25Q128_PAGE_SIZE); + printf("Moving %d bytes from %p to %p\n", N25Q128_PAGE_SIZE, (uint32_t *)(_upgate_vars.addr + block * N25Q128_PAGE_SIZE), (uint32_t *)(_upgate_vars.base_addr + block * N25Q128_PAGE_SIZE)); n25q128_read(_upgate_vars.addr + block * N25Q128_PAGE_SIZE, _upgate_vars.temp_buffer, N25Q128_PAGE_SIZE); n25q128_program_page(_upgate_vars.base_addr + block * N25Q128_PAGE_SIZE, _upgate_vars.temp_buffer, N25Q128_PAGE_SIZE); n25q128_read(_upgate_vars.base_addr + block * N25Q128_PAGE_SIZE, _upgate_vars.read_buf, N25Q128_PAGE_SIZE); @@ -168,7 +168,7 @@ void db_upgate_handle_packet(const db_upgate_pkt_t *pkt) { _upgate_vars.compressed_length = 0; uint32_t base_addr = _upgate_vars.addr + pkt->chunk_index * BUFFER_SIZE; for (uint32_t block = 0; block < pkt->original_size / N25Q128_PAGE_SIZE; block++) { - printf("Programming %d bytes at %p\n", N25Q128_PAGE_SIZE, base_addr + block * N25Q128_PAGE_SIZE); + printf("Programming %d bytes at %p\n", N25Q128_PAGE_SIZE, (uint32_t *)(base_addr + block * N25Q128_PAGE_SIZE)); n25q128_program_page(base_addr + block * N25Q128_PAGE_SIZE, &_upgate_vars.decompressed_buffer[block * N25Q128_PAGE_SIZE], N25Q128_PAGE_SIZE); n25q128_read(base_addr + block * N25Q128_PAGE_SIZE, &_upgate_vars.temp_buffer[block * N25Q128_PAGE_SIZE], N25Q128_PAGE_SIZE); if (memcmp(&_upgate_vars.temp_buffer[block * N25Q128_PAGE_SIZE], &_upgate_vars.temp_buffer[block * N25Q128_PAGE_SIZE], N25Q128_PAGE_SIZE) != 0) { @@ -187,7 +187,7 @@ void db_upgate_handle_packet(const db_upgate_pkt_t *pkt) { } uint32_t addr = _upgate_vars.addr + (pkt->chunk_index - 1) * DB_UPGATE_CHUNK_SIZE; size_t data_size = (pkt->chunk_index == chunk_count - 1 && chunk_count % 2 == 1) ? pkt->original_size : DB_UPGATE_CHUNK_SIZE + pkt->original_size; - printf("Programming %d bytes at %p\n", data_size, addr); + printf("Programming %d bytes at %p\n", data_size, (uint32_t *)addr); n25q128_program_page(addr, _upgate_vars.write_buf, data_size); n25q128_read(addr, _upgate_vars.read_buf, data_size); if (memcmp(_upgate_vars.write_buf, _upgate_vars.read_buf, data_size) != 0) { diff --git a/projects/01bsp_nvmc/01bsp_nvmc.c b/projects/01bsp_nvmc/01bsp_nvmc.c index a2d77e715..f546c7a2b 100644 --- a/projects/01bsp_nvmc/01bsp_nvmc.c +++ b/projects/01bsp_nvmc/01bsp_nvmc.c @@ -38,7 +38,7 @@ int main(void) { db_nvmc_write(address, message, strlen(message)); db_nvmc_read(buffer, address, strlen(message)); - printf("Message written: %s\n", (char *)buffer, strlen(message)); + printf("Message written: %s (len: %d)\n", (char *)buffer, strlen(message)); while (1) { __NOP(); diff --git a/projects/03app_log_dump/main.c b/projects/03app_log_dump/main.c index 78feabf27..698246db9 100644 --- a/projects/03app_log_dump/main.c +++ b/projects/03app_log_dump/main.c @@ -81,7 +81,7 @@ int main(void) { db_log_dotbot_data_t data; db_nvmc_read(&data, _read_address, sizeof(db_log_dotbot_data_t)); printf( - "%lu;%i;%lu;%lu;%u;%lu;%i;%i;%i;%i;%i\n", + "%u;%i;%u;%u;%u;%u;%i;%i;%i;%i;%i\n", timestamp, data.direction, data.pos_x, data.pos_y, data.next_waypoint_idx, data.distance_to_target, data.angle_to_target, data.error_angle, data.angular_speed,