Skip to content
Snippets Groups Projects
Commit d726f2e6 authored by q3k's avatar q3k Committed by Serge Bazanski
Browse files

epicardium: load l0dable when present, for testing

parent 45cd3ec4
No related branches found
No related tags found
No related merge requests found
#include <stdio.h>
#include <stdlib.h>
#include <ff.h>
#include "max32665.h"
#include "uart.h"
#include "cdcacm.h"
......@@ -100,17 +102,28 @@ int main(void)
LOG_INFO("startup", "Initializing dispatcher ...");
api_dispatcher_init();
LOG_INFO("startup", "Testing l0der ...");
struct l0dable_info info;
int res = l0der_load_path("blinky.elf", &info);
if (res != 0) {
LOG_ERR("startup", "l0der failed: %d\n", res);
/*
* See if there's a l0dable.elf to run. If not, run pycardium.
* This is temporary until epicardium gets a l0dable API from pycardium.
*/
const char *l0dable = "l0dable.elf";
if (f_stat(l0dable, NULL) == FR_OK) {
LOG_INFO("startup", "Running %s ...", l0dable);
struct l0dable_info info;
int res = l0der_load_path(l0dable, &info);
if (res != 0) {
LOG_ERR("startup", "l0der failed: %d\n", res);
} else {
LOG_INFO("startup", "Starting %s on core1 ...", l0dable);
core1_start(info.isr_vector);
}
} else {
LOG_INFO("startup", "Starting core1 payload ...");
core1_start(info.isr_vector);
LOG_INFO("startup", "Starting pycardium on core1 ...");
core1_start((void *)0x10080000);
}
LOG_INFO("startup", "Starting FreeRTOS ...");
vTaskStartScheduler();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment