Skip to content

Commit 76565bf

Browse files
facchinmpillo79
authored andcommitted
test: unoq: implement direct RAM loading
1 parent 69ff965 commit 76565bf

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

loader/main.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,17 @@ static int loader(const struct shell *sh) {
159159

160160
gpio_pin_configure_dt(&spec, GPIO_INPUT | GPIO_PULL_DOWN);
161161
k_sleep(K_MSEC(200));
162+
uint8_t *ram_firmware = NULL;
163+
uint32_t *ram_start = (uint32_t *)0x20000000;
164+
if (!sketch_valid) {
165+
ram_firmware = (uint8_t *)k_malloc(64 * 1024);
166+
if (!ram_firmware) {
167+
printk("Failed to allocate RAM for firmware\n");
168+
return -ENOMEM;
169+
}
170+
memset(ram_firmware, 0, 64 * 1024);
171+
*ram_start = &ram_firmware[0];
172+
}
162173
if (gpio_pin_get_dt(&spec) == 0) {
163174
matrixBegin();
164175
matrixSetGrayscaleBits(8);

variants/arduino_uno_q_stm32u585xx/arduino_uno_q_stm32u585xx.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CONFIG_LLEXT_STORAGE_WRITABLE=n
2-
CONFIG_HEAP_MEM_POOL_SIZE=32768
2+
CONFIG_HEAP_MEM_POOL_SIZE=131072
33
CONFIG_SHELL_STACK_SIZE=32768
44
CONFIG_MAIN_STACK_SIZE=32768
55
CONFIG_LLEXT_HEAP_SIZE=128

0 commit comments

Comments
 (0)