diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..26f2661 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,24 @@ +{ + // 使用 IntelliSense 了解相关属性。 + // 悬停以查看现有属性的描述。 + // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "cwd": "${workspaceRoot}/Project", + "executable": "./output/stm32.elf", + "name": "Debug Microcontroller", + "request": "launch", + "type": "cortex-debug", + "showDevDebugOutput": "raw", + "servertype": "openocd", + "configFiles": [ + "interface/stlink-v2.cfg", + "target/stm32f4x.cfg" + ], + "loadFiles": [], + "svdFile": "Project/STM32F429.svd", + "armToolchainPath": "D:/Program Files/arm-gnu-toolchain/bin" + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 8122772..a95b29c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,6 +6,8 @@ "stm32f4xx_fsmc.h": "c", "stm32f4xx.h": "c", "libc.h": "c", - "*.txt": "c" - } + "*.txt": "c", + "*.tmp": "c" + }, + "cortex-debug.variableUseNaturalFormat": false } \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..9f8f690 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,36 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "type": "shell", + "command": "python", + "args": [ + "make.py" + ], + "group": "build", + "options": { + "cwd": "${workspaceFolder}/Project" + }, + }, + { + "label": "download", + "type": "shell", + "command": "openocd", + "args": [ + "-f", + "interface/stlink-v2.cfg", + "-f", + "target/stm32f4x.cfg", + "-c", + "program ./output/stm32.elf verify reset exit" + ], + "group": "build", + "options": { + "cwd": "${workspaceFolder}/Project" + }, + } + ] +} \ No newline at end of file diff --git a/Project/ReadMe.txt b/Project/ReadMe.txt index 6617652..ad9bab8 100644 --- a/Project/ReadMe.txt +++ b/Project/ReadMe.txt @@ -3,14 +3,18 @@ 下载程序 -pyocd flash -t stm32f429xg output/stm32.elf +pyocd flash -t stm32f429xi output/stm32.elf 使用pyocd调试: 1. 启动pyocd -pyocd gdbserver -t stm32f429xg +pyocd gdbserver -t stm32f429xi 2. 启动gdb arm-none-eabi-gdb -ex "target remote localhost:3333" + +使用openocd下载程序 + openocd -f interface/cmsis-dap.cfg -f target/stm32f4x.cfg -c "init; halt; flash write_image erase output/stm32.bin 0x08000000 bin; reset; shutdown" + diff --git a/Project/Src/MyWin/MyWinCore/mywin_font.c b/Project/Src/MyWin/MyWinCore/mywin_font.c index f6ec509..d44e3ba 100644 --- a/Project/Src/MyWin/MyWinCore/mywin_font.c +++ b/Project/Src/MyWin/MyWinCore/mywin_font.c @@ -426,7 +426,7 @@ static u32 WIN_DrawWordAtNormal (char *c,int x,int y) //获取字模 if (g_font==0) g_font=WIN_CreatFontBuff(FONT_NUM); - buff=WIN_GetFontData(g_font,(c[0]<<8)|c[1],&all_byte); + buff=WIN_GetFontData(g_font,(c[0]<<16)|(c[1]<<8)|c[2],&all_byte); diff --git a/Project/Src/MyWinApp/mywin_demo.c b/Project/Src/MyWinApp/mywin_demo.c index de854a6..25c8881 100644 --- a/Project/Src/MyWinApp/mywin_demo.c +++ b/Project/Src/MyWinApp/mywin_demo.c @@ -181,8 +181,8 @@ void baseWin_callback (WIN_WindowStruct *win,WIN_MsgStruct *msg) static int light=1; switch (msg->msg) { - case WIN_MSG_INIT: - break; + case WIN_MSG_INIT: + break; case WIN_MSG_KEY: k=msg->data.p; if (k->shortPress&KEY_VALUE_LIGHT) @@ -191,11 +191,11 @@ void baseWin_callback (WIN_WindowStruct *win,WIN_MsgStruct *msg) light=!light; ui_setScreenBackLightPower (light); } - else if(k->shortPress&KEY_VALUE_DES) - { - // 通知窗口线程调用函数 - WIN_RunInWindow("home",creat_lock,0); - } + else if(k->shortPress&KEY_VALUE_DES) + { + // 通知窗口线程调用函数 + WIN_RunInWindow("home",creat_lock,0); + } if (k->longPress&KEY_VALUE_HOME) { //长按关机键 diff --git a/Project/Src/rt-thread/board.c b/Project/Src/rt-thread/board.c index 4255cea..ebc12ce 100644 --- a/Project/Src/rt-thread/board.c +++ b/Project/Src/rt-thread/board.c @@ -116,6 +116,7 @@ void rt_hw_board_init() // NVIC_SetVectorTable(NVIC_VectTab_FLASH,(u32)128*1024); NVIC_SetVectorTable(NVIC_VectTab_FLASH,(u32)0); _SysTick_Config (SystemCoreClock/1000); + NVIC_SetPriority (SysTick_IRQn, (1<<__NVIC_PRIO_BITS) - 1); LED_Init(); // LED初始�? Usart_Config(); // 串口初始�? SDRAM_Init(); // sdram要先于emwin之前初始�? diff --git a/Project/pyocd.yaml b/Project/pyocd.yaml index 629fe5d..086b2ba 100644 --- a/Project/pyocd.yaml +++ b/Project/pyocd.yaml @@ -3,7 +3,7 @@ # 1. 目标芯片配置 target: # 指定芯片型号(覆盖命令行 -t 参数) - name: stm32f429xg + name: stm32f429xi # 可选:覆盖默认时钟频率(单位 Hz) clock: 180000000