build: W600-SDK importiert, Firmware-Build und Hello am EVK
Docker-Build mit gcc-arm-none-eabi 4.9-2014q4 (statt Homebrew-Cask) verwendet, Dockerfile/tools/docker.sh dafür aus Task 13 vorgezogen. cmake/sdk.cmake schont gcc 4.9 (kennt -fcommon/-Wno-error=... nicht). Zwei zusätzliche SDK-Stubs (EarlyInit, pre_gpio_config) in src/sys/sdk_stubs.c ergänzt, siehe sdk/PATCHES.md.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include "wm_include.h"
|
||||
|
||||
#define NL_APP_TASK_PRIO 40
|
||||
static u32 s_app_stack[512];
|
||||
|
||||
static void app_task(void *arg)
|
||||
{
|
||||
unsigned int n = 0;
|
||||
(void)arg;
|
||||
for (;;) {
|
||||
printf("ninlight %s alive %u\r\n", NINLIGHT_DEVICE_ID, n++);
|
||||
tls_os_time_delay(HZ);
|
||||
}
|
||||
}
|
||||
|
||||
void UserMain(void)
|
||||
{
|
||||
printf("\r\nninlight %s for %s (built %s)\r\n", NINLIGHT_FW_VERSION, NINLIGHT_DEVICE_ID, NINLIGHT_BUILD_DATE);
|
||||
tls_os_task_create(NULL, "nl_app", app_task, NULL, (u8 *)s_app_stack, sizeof(s_app_stack), NL_APP_TASK_PRIO, 0);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
#include "sys/nl_fwup_hook.h"
|
||||
|
||||
/* Until OTA support (plan 3) provides a strong definition, every update is rejected. */
|
||||
__attribute__((weak)) bool nl_fwup_verify_tail(const uint8_t sha256[32], const uint8_t *tail, uint32_t tail_len)
|
||||
{
|
||||
(void)sha256;
|
||||
(void)tail;
|
||||
(void)tail_len;
|
||||
return false;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
#ifndef NL_FWUP_HOOK_H
|
||||
#define NL_FWUP_HOOK_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/* Called by the SDK updater (sdk/Platform/Common/fwup/wm_fwup.c) after the image CRC
|
||||
* matched. sha256 covers the T_BOOTER header plus payload, tail is the 512 byte block
|
||||
* appended to the image. Return true to accept the image. */
|
||||
bool nl_fwup_verify_tail(const uint8_t sha256[32], const uint8_t *tail, uint32_t tail_len);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,14 @@
|
||||
/* ninlight: minimal stand-ins for the two board-init hooks that
|
||||
* sdk/Platform/Sys/wm_main.c expects the application to provide
|
||||
* (`extern void EarlyInit(void);` / `extern void pre_gpio_config();`).
|
||||
* The old QConnex firmware (qconnex_sdk/src/qc_main.c) defined pre_gpio_config()
|
||||
* as an empty no-op, and used EarlyInit() only to call into its own QConnex
|
||||
* hardware layer (QCXH_EarlyInit()), which ninlight does not use. See sdk/PATCHES.md. */
|
||||
|
||||
void EarlyInit(void)
|
||||
{
|
||||
}
|
||||
|
||||
void pre_gpio_config(void)
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user