Skip to content

Commit

Permalink
tests: portability cmsis_rtosv2: Fix buffer aligment
Browse files Browse the repository at this point in the history
The kernel requires the buffer to be word aligned.
Instead of assuming the word size is 32bits,
lets align the buffer to the size of a pointer,
which should match the word size (and which
is the check the kernel performs).

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
  • Loading branch information
aescolar authored and fabiobaltieri committed Jun 20, 2023
1 parent 175abfb commit 5850636
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/subsys/portability/cmsis_rtos_v2/src/mempool.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ struct mem_block {
int member2;
};

static char __aligned(4) sample_mem[sizeof(struct mem_block) * MAX_BLOCKS];
static char __aligned(sizeof(void *)) sample_mem[sizeof(struct mem_block) * MAX_BLOCKS];
static const osMemoryPoolAttr_t mp_attrs = {
.name = "TestMempool",
.attr_bits = 0,
Expand Down

0 comments on commit 5850636

Please sign in to comment.