1511浏览
查看: 1511|回复: 1

崩溃

[复制链接]
请各位大神看看,为何会报错?

错误:
1610612736

Stack smashing protect failure!

abort() was called at PC 0x400dfde4 on core 1

Backtrace: 0x40088f20:0x3ffb1f10 0x4008914d:0x3ffb1f30 0x400dfde4:0x3ffb1f50 0x400d1235:0x3ffb1f70 0x400d9a7a:0x3ffb1fb0 0x40085095:0x3ffb1fd0

Rebooting...
-1610612736

Stack smashing protect failure!

abort() was called at PC 0x400dfde4 on core 1

Backtrace: 0x40088f20:0x3ffb1f10 0x4008914d:0x3ffb1f30 0x400dfde4:0x3ffb1f50 0x400d1235:0x3ffb1f70 0x400d9a7a:0x3ffb1fb0 0x40085095:0x3ffb1fd0

Rebooting...



返回的速度变成了8位数



代码

  1. #include "DFRobot_BC20.h"
  2. #include <U8g2lib.h>
  3. #ifdef U8X8_HAVE_HW_SPI
  4. #include <SPI.h>
  5. #endif
  6. DFRobot_BC20 myBC20;
  7. U8X8_SSD1306_128X64_NONAME_SW_I2C u8x8(/* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ U8X8_PIN_NONE);
  8. void setup() {
  9.   /* U8g2 Project: SSD1306 Test Board */
  10.   //pinMode(10, OUTPUT);
  11.   //pinMode(9, OUTPUT);
  12.   //digitalWrite(10, 0);
  13.   //digitalWrite(9, 0);
  14.   /* U8g2 Project: KS0108 Test Board */
  15.   //pinMode(16, OUTPUT);
  16.   //digitalWrite(16, 0);
  17.   Serial.begin(115200);
  18.   u8x8.begin();
  19.   u8x8.setPowerSave(0);
  20.   while (!myBC20.powerOn()) {
  21.     delay(1000);
  22.   }
  23.   if (myBC20.getQGNSSC() == OFF) {
  24.     Serial.println("open QGNSSC");
  25.     myBC20.setQGNSSC(ON);
  26.     while (!myBC20.powerOn()) {
  27.       delay(1000);
  28.     }
  29.   }
  30.   delay(1000);
  31. }
  32. void loop() {
  33.   myBC20.getQGNSSRD();
  34.   char time1 [10] = {0};
  35.   char speed1 [10] = {0};
  36.   sprintf(time1, "%d:%d", sCLK.Hour + 8, sCLK.Minute);
  37.   sprintf(speed1, "%d", sGGNS.Speed);
  38.   u8x8.setFont(u8x8_font_8x13B_1x2_r);
  39.   u8x8.setCursor(0, 0); //这里设置显示的坐标
  40.   u8x8.print(time1);//输出显示内容
  41.   u8x8.refreshDisplay();
  42.   u8x8.setFont(u8x8_font_8x13B_1x2_r);
  43.   if (sSAT.USE >= 7)
  44.   { u8x8.setCursor(41, 0); //这里设置显示的坐标
  45.     u8x8.print("READY");//输出显示内容
  46.    
  47.   }
  48.   else{
  49.     u8x8.setCursor(43, 0); //这里设置显示的坐标
  50.     u8x8.print("WAIT");//输出显示内容
  51.    
  52.   }
  53.   u8x8.setFont(u8x8_font_profont29_2x3_n);
  54.   u8x8.drawString(2, 2, speed1);
  55. Serial.println(speed1);
  56.   
  57.   u8x8.refreshDisplay();
  58. }
复制代码
如有回答将不胜感激

hnyzcj  版主

发表于 2022-1-24 08:29:18

问题最好描述清楚点,这样方便大家帮你解决
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

为本项目制作心愿单
购买心愿单
心愿单 编辑
[[wsData.name]]

硬件清单

  • [[d.name]]
btnicon
我也要做!
点击进入购买页面
上海智位机器人股份有限公司 沪ICP备09038501号-4

© 2013-2024 Comsenz Inc. Powered by Discuz! X3.4 Licensed

mail