今天是一个奇怪的日子,我的jlink突然丢固件了,也就是变砖了,我没有自动升级。
其次,由于变砖,导致我用mdk无法烧录程序(一点开设置选项就卡死,任务管理器都无法关闭),所以我用stm32 utilities 烧录,硬是折腾死我了!!!!
居然是上位机软件问题。
解决办法,把jlink的usb拔掉,mdk5就能正常设置了,stlink能烧录,但是单独使用stm32 utilities 烧录任然不行!!!!!!!
既然能搞了,那就搞起来吧,花了一下午,驱动st7920,杠杠滴!!
- int main(void)
- {
- /* STM32F4xx HAL library initialization:
- - Configure the Flash prefetch and Buffer caches
- - Systick timer is configured by default as source of time base, but user
- can eventually implement his proper time base source (a general purpose
- timer for example or other time source), keeping in mind that Time base
- duration should be kept 1ms since PPP_TIMEOUT_VALUEs are defined and
- handled in milliseconds basis.
- - Low Level Initialization
- */
- HAL_Init();
- SystemClock_Config(); /* Configure the system clock to 100 MHz */
- BSP_LED_Init(LED2);
- BSP_PB_Init(BUTTON_USER, BUTTON_MODE_GPIO);
-
- LCD_Init();
- BLK_ON;
- LCD_Clear_GDRAM();
-
-
- HAL_Delay(800);
- LCD_Clear_DDRAM();
-
- while (1)
- {
-
- BSP_LED_Toggle(LED2);
- HAL_Delay(500);
-
- LCD_Clear_GDRAM();
- ShowStringPos(1, 1,"ST7920 LCD");
- ShowStringPos(2, 1,"TEST OK");
-
-
- }
- }
嘿嘿,看图:
很爽吧~~~