mirror of
https://github.com/micropython/micropython.git
synced 2025-12-13 08:20:13 +01:00
alif: Link with libnosys.
This allows the correct start up functions to be called by the stdlib. Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
This commit is contained in:
committed by
Damien George
parent
182b5f3a12
commit
68b1dae011
@@ -68,9 +68,9 @@ CFLAGS += $(INC) \
|
||||
-mtune=cortex-m55 \
|
||||
$(CFLAGS_FPU) \
|
||||
-march=armv8.1-m.main+fp+mve.fp \
|
||||
-nostdlib \
|
||||
-fdata-sections \
|
||||
-ffunction-sections \
|
||||
--specs=nosys.specs \
|
||||
-D$(MCU_CORE)=1 \
|
||||
-DCORE_$(MCU_CORE) \
|
||||
-DALIF_CMSIS_H="\"$(MCU_CORE).h\""
|
||||
@@ -95,17 +95,16 @@ CFLAGS += $(CFLAGS_EXTRA)
|
||||
|
||||
AFLAGS = -mthumb -march=armv8.1-m.main+fp+mve.fp $(CFLAGS_FPU)
|
||||
|
||||
LDFLAGS += -nostdlib \
|
||||
-T$(BUILD)/ensemble.ld \
|
||||
-Map=$@.map \
|
||||
--cref \
|
||||
--gc-sections \
|
||||
--print-memory-usage
|
||||
ifeq ($(MCU_CORE),M55_HP)
|
||||
LDFLAGS += --wrap=dcd_event_handler
|
||||
endif
|
||||
CFLAGS += -Wl,-T$(BUILD)/ensemble.ld \
|
||||
-Wl,-Map=$@.map \
|
||||
-Wl,--cref \
|
||||
-Wl,--gc-sections \
|
||||
-Wl,--print-memory-usage \
|
||||
-Wl,--no-warn-rwx-segment
|
||||
|
||||
LIBS += "$(shell $(CC) $(CFLAGS) -print-libgcc-file-name)"
|
||||
ifeq ($(MCU_CORE),M55_HP)
|
||||
CFLAGS += -Wl,--wrap=dcd_event_handler
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
# Source files and libraries
|
||||
@@ -126,6 +125,7 @@ SRC_C = \
|
||||
mpu.c \
|
||||
mpuart.c \
|
||||
msc_disk.c \
|
||||
nosys_stubs.c \
|
||||
ospi_ext.c \
|
||||
ospi_flash.c \
|
||||
pendsv.c \
|
||||
@@ -256,7 +256,7 @@ $(BUILD)/ensemble.ld: $(LD_FILE)
|
||||
|
||||
$(BUILD)/firmware.elf: $(OBJ) $(BUILD)/ensemble.ld
|
||||
$(ECHO) "Link $@"
|
||||
$(Q)$(LD) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
|
||||
$(Q)$(CC) $(CFLAGS) -o $@ $(OBJ) $(LIBS)
|
||||
$(Q)$(SIZE) $@
|
||||
|
||||
$(BUILD)/firmware.bin: $(BUILD)/firmware.elf
|
||||
|
||||
@@ -55,7 +55,7 @@ NORETURN void panic(const char *msg) {
|
||||
}
|
||||
}
|
||||
|
||||
void _start(void) {
|
||||
int main(void) {
|
||||
system_tick_init();
|
||||
|
||||
MICROPY_BOARD_STARTUP();
|
||||
|
||||
46
ports/alif/nosys_stubs.c
Normal file
46
ports/alif/nosys_stubs.c
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* This file is part of the MicroPython project, http://micropython.org/
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2024 OpenMV LLC.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
#include <errno.h>
|
||||
|
||||
int _write(int handle, char *buffer, int size) {
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int _read(int handle, char *buffer, int size) {
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int _close(int f) {
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int _lseek(int f, int ptr, int dir) {
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
}
|
||||
Reference in New Issue
Block a user