Skip to content

Commit

Permalink
s32k3xx: Replace assert with runtime logged error
Browse files Browse the repository at this point in the history
* Pulling __assert_func() and fiprintf() costs ~1.5 KiB of BMF flash
* Target flash layer is guaranteed to call this with len=writesize anyways
  • Loading branch information
ALTracer committed Aug 17, 2024
1 parent ac2605c commit 9ce0619
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/target/s32k3xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
* the XML memory map and Flash memory programming.
*/

#include <assert.h>

#include "command.h"
#include "general.h"
#include "target.h"
Expand Down Expand Up @@ -250,7 +248,11 @@ static bool s32k3xx_flash_erase(target_flash_s *const flash, target_addr_t addr,

static bool s32k3xx_flash_write(target_flash_s *flash, target_addr_t dest, const void *src, size_t len)
{
assert(len == flash->writesize);
if (len != flash->writesize) {
DEBUG_ERROR("%s: len %" PRIu32 " does not match writesize %" PRIu32 "!\n", __func__, (uint32_t)len,
(uint32_t)flash->writesize);
return false;
}

const uint32_t *const s_data = src;
s32k3xx_flash_prepare(flash);
Expand Down

0 comments on commit 9ce0619

Please sign in to comment.