修复qemu,linux上运行问题

This commit is contained in:
zhangzheng
2024-02-29 11:16:23 +08:00
parent 07eaa699f6
commit cf57b3a392
11 changed files with 21 additions and 17 deletions

View File

@@ -14,7 +14,7 @@
| -------- | -------- | -------- |
| Cortex-m3| renode/stm32f103,qemu/stm32f2 | done |
| Cortex-m4 | renode/stm32f4 | done |
| Cortex-m33swm34sdone|
| Cortex-m33|swm34s|done|
| risc-v | Qemu | X |
| ARMv8|Qemu|X
@@ -74,11 +74,15 @@ sudo apt install cmake
```
sudo apt update
sudo apt install ninja-build
sudo apt install cpio srecord
sudo apt install python3
```
3. 下载gcc
- 直接使用ubuntu命令安装的gcc arm会没有gdb可以直接到我给定的仓库下载
```
https://gitee.com/IsYourGod/mkrtos-tools.git
64位系统使用32位gcc需要安装
sudo apt install libc6-i386
```
4. Qemu
- 1.Qemu可以直接下载官方的进行编译

View File

@@ -110,5 +110,5 @@ CONFIG_RT_USING_PIN=y
CONFIG_CPU_TYPE="stm32f1"
CONFIG_RTT_DIR="./"
CONFIG_ARCH="cortex-m3"
CONFIG_KNL_EXRAM=y
CONFIG_KNL_EXRAM=n
CONFIG_BOARD_NAME="STM32F103ZET6"

View File

@@ -7,5 +7,5 @@ export TOOLCHAIN_LIB=/home/zhangzheng/gcc-arm-none-eabi-5_4-2016q3/lib/gcc/arm-n
export BOARD=STM32F103ZET6
set -e
cmake -G Ninja -B build/$KNL .
cd build/$KNL && ninja
cmake -G Ninja -B build .
cd build && ninja

View File

@@ -7,5 +7,5 @@ export TOOLCHAIN_LIB=/home/zhangzheng/gcc-arm-none-eabi-5_4-2016q3/lib/gcc/arm-n
export BOARD=SWM34
set -e
cmake -G Ninja -B build/$KNL .
cd build/$KNL && ninja
cmake -G Ninja -B build .
cd build && ninja

View File

@@ -15,7 +15,7 @@ include_directories(
add_subdirectory(init)
add_subdirectory(shell)
# add_subdirectory(app)
# add_subdirectory(fs)
add_subdirectory(fs)
add_subdirectory(hello)
add_subdirectory(drv)
# add_subdirectory(test)

View File

@@ -6,4 +6,4 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMKRTOS_DRV ")
# add_subdirectory(dm9000_drv)
add_subdirectory(lcd_drv)
# add_subdirectory(lcd_drv)

View File

@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.13)
add_subdirectory(fatfs)
add_subdirectory(cpiofs)
# add_subdirectory(cpiofs)
# add_subdirectory(fatfs)

View File

@@ -73,10 +73,10 @@ add_custom_target(
${CMAKE_SIZE} fatfs.elf
COMMAND
mkdir -p ${CMAKE_SOURCE_DIR}/build/output/cpio
# COMMAND
# cp fatfs.bin ${CMAKE_SOURCE_DIR}/build/output/cpio/fatfs
# COMMAND
# cp fatfs.elf ${CMAKE_SOURCE_DIR}/build/output/fatfs.elf
COMMAND
cp fatfs.bin ${CMAKE_SOURCE_DIR}/build/output/cpio/fatfs
COMMAND
cp fatfs.elf ${CMAKE_SOURCE_DIR}/build/output/fatfs.elf
)
add_dependencies(fatfs_dump fatfs.elf)

View File

@@ -1,6 +1,6 @@
#define HEAP_SIZE 2048
#define STACK_SIZE (2048)
#define STACK_SIZE (1024 + 512)
#if defined(__CC_ARM)
#define HEAP_ATTR SECTION("HEAP") __attribute__((zero_init))

View File

@@ -11,7 +11,7 @@ int main(int argc, char *args[])
{
printf("args[%d]:%s\n", i, args[i]);
}
pm_run_app("lcd_drv", 0);
// pm_run_app("lcd_drv", 0);
userShellInit();
return 0;
}

View File

@@ -27,7 +27,7 @@ message(=======${CONFIG_CPU_TYPE})
# -mfloat-abi=soft -u _printf_float -lc -lrdimon
#-mfpu=fpv5-sp-d16
set(CMAKE_C_FLAGS "-mcpu=${CONFIG_ARCH} -O3 -g3 -mfloat-abi=${CONFIG_FLOAT_TYPE} -mthumb -mno-thumb-interwork -D=MKRTOS \
set(CMAKE_C_FLAGS "-mcpu=${CONFIG_ARCH} -O0 -g3 -mfloat-abi=${CONFIG_FLOAT_TYPE} -mthumb -mno-thumb-interwork -D=MKRTOS \
-std=gnu11 -ffunction-sections -fdata-sections -fno-builtin -u _printf_float \
-nostartfiles -nodefaultlibs -nostdlib -nostdinc -Xlinker \
-fno-stack-protector -Wl,--gc-sections \