硬件原因导致stm32L0系列单片机无法下载程序

事件的起因是用stm32l0系列单片机做了一批简单的传感器,原理也很简单,就是感知环境变化到一定阈值后变换高地电平。

程序为两个版本,一个用于测试(用于输出当前环境变量),一个正式使用的时候。

成品除了感知部分外全部用环氧树脂灌封,因为最终程序已经烧录好,所以只留了电源线和一条用于电平变化的信号线,这三根线长度50cm左右(这是重点)。其实还有SCLK和SWDIO这两根,已从引出位置根部减除。

后来客户使用过程中想要感知速度再快一点,我们就通过升级代码解决,客户把剩余产品寄回来,我们通过焊接方式把成品程序下载线引出来15cm左右。电源线用原来成品上的。

首先通过STM32 ST-LINK Utility配合st-link下载,发现能检测到单片机,而且还能读取单片机内部flash,点下载就出错。而且上电的时候检测单片机能正常运行,就是不能下载程序。

再用MDK5打开程序,在调试配制里面也能检测到单片机,配制也正确,无论下载或调试都出错,显示找不到flash。

到这尝试了各种方式,网上找原因可能是单片机电平变化导致芯片写保护了,那就想办法解除保护吧,还是不行。同事也帮忙找了不用方式,换了几台电脑还是不行。st-link都换了好几个。

后来想着是不是成品灌粉因为拉扯焊盘有虚短,所以检测到,写就不行。

最后是在没办法破除灌封胶,把下载线怼到板子上,此时用的板子另外一个GND点,一下就下载好了,因为布局原因,这两个GND之间用的线连接,以为是这边这个GND接口和另外一边铜皮断裂。用万用表测试连接良好,那不应该呀。

这下重点来了,我把引出线GND用短一点的线连接出来,连接电脑程序下载成功。到这还没完,我就把剩下产品GND线都从接口处剥开连接,最后都成功了。

总结:程序无法烧写单片机没有锁定情况下,有可能是电源GND线太长,导致干扰从而数据传送过程中干扰失效。

第一次在CSDN发布,记录开始入行电子圈踩过的坑。不足之处感谢各位道友指点

 

 

STM32L011D4P6仅仅14个引脚,本评估板有2颗用户LED,1个用户按键,1个复位按键,引出全部IO,板载TI开关电源芯片tps563200,输入电压范围4.5V——17V,设计输出电压5V,最大输出电流3A,另外板载TI电平转换芯片TXB0104,以拓展4个5VGPIO。可用于驱动5V逻辑器件,例如RGB5050 WS2812B。 以下是STM32L011D4P6的官网介绍: The access line ultra-low-power STM32L011xx family incorporates the high-performance ARM:registered: Cortex:registered:-M0+ 32-bit RISC core operating at a 32 MHz frequency, high-speed embedded memories (up to 16 Kbytes of Flash program memory, 512 bytes of data EEPROM and 2 Kbytes of RAM) plus an extensive range of enhanced I/Os and peripherals. The STM32L011xx devices provide high power efficiency for a wide range of performance. It is achieved with a large choice of internal and external clock sources, an internal voltage adaptation and several low-power modes. The STM32L011xx devices offer several analog features, one 12-bit ADC with hardware oversampling, two ultra-low-power comparators, several timers, one low-power timer (LPTIM), three general-purpose 16-bit timers, one RTC and one SysTick which can be used as timebases. They also feature two watchdogs, one watchdog with independent clock and window capability and one window watchdog based on bus clock. Moreover, the STM32L011xx devices embed standard and advanced communication interfaces: one I2C, one SPI, one USART, and a low-power UART (LPUART). The STM32L011xx also include a real-time clock and a set of backup registers that remain powered in Standby mode. The ultra-low-power STM32L011xx devices operate from a 1.8 to 3.6 V power supply (down to 1.65 V at power down) with BOR and from a 1.65 to 3.6 V power supply without BOR option. They are available in the -40 to +125 °C temperature range. A comprehensive set of power-saving modes allows the design of low-power applications. Key Features Ultra-low-power platform1.65 V to 3.6 V power supply -40 to 125 °C temperature range 0.23 μA Standby mode (2 wakeup pins) 0.29 μA Stop mode (16 wakeup lines) 0.54 μA Stop mode + RTC + 2 KB RAM retention Down to 76 μA/MHz in Run m
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值