STM32WB55使用问题————dongle调用nucleo的配置文件stm32wbxx_nucleo.h

场景:

使用官方例程,有一些是没有USB Dongle的例程的,nucleo的引脚和dongle的引脚是不同的,若需要用到按钮,则需要自己手动将nucleo的配置文件按钮的引脚更改成dongle的引脚。

问题描述:

使用过程发现,单纯更改配置文件的引脚按钮,并没有任何反应,需要在CubeMX里面添加引脚输入,并设置为Pull-up。
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述


原因分析:

未知,可能是CubeMX配置生成的文件会覆盖代码的设置(可能!可能!这一点我也觉得很迷)


解决方案:

在看代码的时候发现,主函数中有个GPIO初始化,于是抱着试试的心态,将nucleo的stm32wbxx_nucleo.h中的按钮引脚改成dongle的引脚,再将官方配置文件的按钮初始化BSP_PB_Init(BUTTON_SW1, 0) 加到主函数里,果然就可以正常使用按钮了。

Uubt is for McU UsB BlueTooth ============================= This is a demo application for bluetooth USB dongle connected to STM32F4DISCOVERY (http://www.st.com/internet/evalboard/product/252419.jsp) board based on BTstack (http://code.google.com/p/btstack) project and ST USB libraries. LICENSING --------- My files are licensed under the terms of GPLv3, although I haven't thoroughly investigated the licenses compatibility for packages used. Please note that files from different projects involved use different licences. WHAT IS SPECIAL --------------- Pure FOSS components using hardware comprized of very cheap STM32F4DISCOVERY board and commodity bluetooth USB dongles. WHAT YOU NEED ------------- - STM32F4DISCOVERY board - cable to connect it to USB dongle (I use normal USB A male to micro-USB cable + USB A female/USB A female adapter) - USB dongle: USB parameters are currently hardcoded rather than read from descriptors, so you should verify that they match (I use lsusb -v for that purpose). Dongles tested thus far are: CSR and Atheros AR3011. Firmware loading is implemented for some Atheros chips but it is not very stable. - toolchain and libraries. I use linux, code sourcery lite (eabi build), https://github.com/texane/stlink project. You should download btstack source and STM32F4DISCOVERY firmware package (http://www.st.com/internet/com/SOFTWARE_RESOURCES/SW_COMPONENT/FIRMWARE/stm32f4discovery_fw.zip). COMPILING --------- Currently 2 build flavours are supported: bare (no OS) and for ChibiOS/RT (http://www.chibios.org). To build for ChibiOS/RT, additionally download respective sources (I use trunk, which is currently at 2.3.4+). You will probably not need newlib_stubs.c here. The description below is for no-OS build. Fix ST libs (mine are marked as 1.1.0 revision) using the patch provided. Btstack source probably needs configuring (I'm not sure). Couple of build options are currently implemented via Makefile variables, see Makefile head for
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值