本帖最后由 abaelhe 于 2023-12-17 22:32 编辑
#申请原创#
@21小跑堂
----
2023-12-11
首先得奖。感谢美利坚,Microchip,21ic,... ,缘份。
收到评估板,学习Microchip官方给的WBZ451的文档,应用及示例。
创建新 project 时, 遇到几个问题,论坛上的朋友们可有能解答的 ?
- 下载 IDE(集成开发环境)时,最新的 MPLAB® Harmony v3 官方下载链接断链("Page Not Found) 。于是,下载使用的是 MPLAB X IDE v6.15(官方推出新一代的WBZ451集成电路硬件新产品,要有 Elon Musk做Tesla的思路:配套的IDE软件/文档/示例/教程/服务/销售/支持 也要及时的更新完善, 对Customers,Partners,生态圈,以上的每一项都非常重要。)
- project properties 的 configuration 的 device 选择 “ATSAME70N21B” ? 还是 “WBZ451” ?官方Application Notes上并没有给出明确的文档,对 WBZ451 Curiosity Board 这一类组合多芯片式的应用,需要给用户一个选择的策略与判断条件(因为 的 PKOB4 是由Microchip芯片ATSAME70N21B + USB2512 + MCP2200 组合实现的)。
- 官方示例上,用到 “MBD(Microchip Bluetooth Data)” 的 Android apk哪里有下载 ?Google Play App Store 上谁下载到传我一份 ?
----2023-12-12
上面的“问题1”确实存在,首先断链("Page Not Found)需要在官网更新页面。经过不懈探索,终于解决“问题2”并找出原因:
1. project properties 的 configuration 的 device 选择 “WBZ451” !
2. WBZ451 Curiosity Board 必须要在 MPLAB X IDE 启动打开project之后连接, MCC 的Configuration 界面的 “Connected Hardware Tool” 才出现 "WBZ451...";
3. 我安装IDE以及MCC没有任何问题。
成功检测出评估板硬件连接的Screenshot如图1 所示。
----
2023-12-13
硬件问题都解决,告一段落;接下来搞定IDE软件:
- MCC(Microchip Content Manager) 使用NodeJs的 npmjs (Package Management System) 实现可扩展的软件配置;
- npmjs 访问默认美国的 https://registry.npmjs.org/ 受限(我的联通包年5G流量卡网络是这样的),可以设为 http://npm.tuna.tsinghua.edu.cn/registry,http://mirrors.cloud.tencent.com/npm,https://registry.npm.taobao.org,https://registry.npmjs.org/ 先解决,如图2; 重新打开 MCC,并点击“Finish” button, MCC就可以自动下载 Required Content。
3. 官方运行示例应用的前提条件 Prerequisites :- Install MPLAB X IDE
- Install XC32 Compliler
- Install DFP(Device Family Part Pack)
- Install MCC Plugin
- Install Harmony 3 Dependencies( set npmjs registry)
4. 配置MCC: "menu bar" -> (MPLAB X IDE) -> "Preferences..." → Plugins → MPLAB Code Configurator *
* "Editor Behavior":
- check "Show Development log": 打开开发日志,对MPLAB X IDE的配置与调试非常有用;
- Always ask before remove a pin
* Offline Mode: "Run MCC in Offline Mode": 离线模式可以熟悉IDE 及 Microchip的设计
- Core(Indexed by **.mc3core** file): "Open Core Folder"
- Library(Indexed by **.jar/. mc3lib**file): "Open Library Folder"
- Reset Plugin Files
* MCC Content Registry(Enter as a comma separated list): http://mirrors.cloud.tencent.com/npm,https://registry.npm.taobao.org,https://registry.npmjs.org/
* Harmony Repository: https://github.com/Microchip-MPLAB-Harmony
* Harmony Content Path: ~/.mcc/HarmonyContent
* **Installing an "Core" for MCC(MPLAB Code Configurator)**: click on the "Install Core" button and select the **.mc3core**
* **Installing an "Library" for MCC(MPLAB® Code Configurator)**: An MCC Library file may have **a .jar or a .mc3lib** file extension
5. MCC 启动时Error解决(“~/.mcc/HarmonyContent/csp/csp/package.yml” 文件不存在的);
* 首先 “~/.mcc/HarmonyContent" 是 HarmonyContent 的 content 目录;
Error提示的信息是 csp 这个 content package不存在, 如图3,必须要大于一定版本的 csp 存放在此目录;
下载 https://github.com/Microchip-MPLAB-Harmony/core,选择最新release的tag -> "Code Button"->"Download ZIP"
下载解压后放到 ~/.mcc/HarmonyContent 目录下;并查看 package.xml , 可见core的依赖及版本:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Dependency name="bsp" version="v3.16.0"/>
<Dependency name="csp" version="v3.17.0"/>
<Dependency name="CMSIS-FreeRTOS" version="v10.5.1"/>
<Dependency name="littlefs" version="v2.5.1"/>
<Dependency name="filex" version="v6.2.1_rel"/>
</Dependencies>
</Package>
一一安装:
bsp: v3.16.0: https://codeload.github.com/Microchip-MPLAB-Harmony/bsp/zip/refs/tags/v3.16.0
csp: v3.17.0: https://codeload.github.com/Microchip-MPLAB-Harmony/csp/zip/refs/tags/v3.17.0
CMSIS-FreeRTOS:v10.5.1:https://github.com/ARM-software/CMSIS-FreeRTOS/tree/v10.5.1
littlefs: v2.5.1 : https://codeload.github.com/littlefs-project/littlefs/zip/refs/tags/v2.5.1
filex: v6.2.1_rel : https://github.com/azure-rtos/filex/releases 附件: Real-Time_Embedded_Multithreading_with_ThreadX_4th_Edition.pdf
* 准备MCC安装配置完毕, 重新打开 MCC 不再报错; 如 图4;
----2023-12-14
1. 通过Term连接WBZ451的USB-UART虚拟出的串口,需要检测 MacOS 上连接的USB硬件及其设备文件:- “System Information”这个Apple自带的GUI小App是检测USB硬件的; 如图5(PKoB4) 与 图6(MCP2200) 所示;而Linux上是 lsusb 与 lspci 这类command line的command;
- 找到 USB 硬件的设备信息,需要与设备文件映射,怎么找?
- 综合以上确定 MacOS 为 USB 硬件创建的设备文件(/dev/*)包含有设备信息的“Serial Number”;而Linux上则是以ProdID(产品序号) 与 VendID(厂商序号) 确定;
- 再碰到需要查找 USB硬件设备文件,直接 ls /dev/*<Serial Number>* 就可以找出。
----2023-12-15
1. C-Kermit 的 ~/.kermrc 配置文件(自动连接 WBZ451 的PKoB4 的USB-USART Virtual COM):
;
; Connect to WBZ451 USB-USART Virtual COM
def connWBZ451 {
SET PORT \%1 ; Specify device name
SET SPEED 115200 ; Or other desired speed
SET CARRIER-WATCH OFF ; If DTR and CD are not cross-connected, or
; To CONNECT to a Serial Device that is not presenting the Carrier Detect signal
SET TERMINAL BYTESIZE 8
SET COMMAND BYTESIZE 8
SET PARITY NONE ; {"NONE","EVEN", "ODD", "MARK", "SPACE"}
SET FLOW /DIRECT-SERIAL NONE ; Flow control Type:{"keep", "none", "rts/cts", "xon/xoff"}
;or Connection Type:{"/direct-serial", "/modem", "/remote", "/tcpip"}
SET STOP-BITS 1 ; (rarely necessary)
IF FAIL END 1 ;
IF SUCCESS CONNECT ; Enter Connect (terminal) state
}
;/dev/tty.usbmodem00112053651 此处修改为你电脑上的 usb 设备文件;
connWBZ451 /dev/tty.usbmodem00112053651
2. COM Port Setup Using C-Kermit(PIC32CXBZ2 APPLICATION DEVELOPER'S GUIDE) To resolve COM port issues that prevent the output of text to the terminal using the WBZ451 curiosity board, follow these steps: - Close C-Kermit and unplug the curiosity board from the computer.
- Plug the Curiosity board back into the computer.
- execute "kermit" in the command line.
- press the "RESET" button on the WBZ451 Curiosity Board to see text on the terminal if the Curiosity Board is programmed to do that.
图7: C-Kermit连接WBZ451成功时的提示信息与help与zclHelp 命令的输出:
3. 示例应用:https://github.com/Microchip-MPLAB-Harmony/wireless_apps_pic32cxbz2_wbz45
先用 git clone 以上的示例MCU App;
3.1 Select File > Open Project,
Browse to project location of choice (In this example, it is "ble_sensor_app") project, select project file from the location "<Harmony Content Path>wireless_apps_pic32cxbz2_wbz45/apps/ble/advanced_applications/ble_sensor/firmware/ble_sensor.X"
3.2 Open Project Properties:
- Select WBZ451 Curiosity Board as hardware tool for programming
- Ensure correct DFP latest is selected as mentioned in the Tools and Harmony Components
- Select XC32 compiler
3.3 Open Project Properties:
Select option Build Project in IDE to compile the application example
这一步遇到官方github 示例源码的问题:提示 "Private key file: ... /..\ble_sensor.X/java_friendly_private_key.pem not found"
已经解决Build成功,并将patch提交官方源码仓库 Pull Request;
3.4 Select option Run Project in IDE to program the target – the onboard debugger will program the example application.
3.5 刷机完毕,重连WBZ451 Curiosity Board的USB连接;
3.6 重用 C-Kermit 连接 programmed 新 wireless_apps_pic32cxbz2_wbz45 的firmware的 WBZ451 Curiosity Board;
按下评估板上的 “RESET BUTTON” 看到如 图8 所示信息,
证明首次刷firmware成功, 但是官方的示例App还有彩蛋 ;-)
----
2023-12-17至于开发Android/iOS App及32/64-bit MCU上的App, 包括支持Bluetooth LE或WiFi, 与以前做的完整系统级软件大同小异;-)
Anyway, if consider those MCUs as flights of Microchip make, we are pilots now, who can maneuvering such kind of flights.
But, we have more important mission.Thanks for Microchip, Columbia University who sponsored the C-Kermit project, and Oracle who sponsored the Netbeans Project Also.
microchip/mplabx, 是 Microchip 在 Oracle 主导的 Netbeans IDE上开发的,
Microchip 的 Packs DFP(Device Family Package Microchip) 部分是用 Python 实现:# /Applications/microchip/mplabx/v6.15/packs/Microchip/SAME70_DFP/4.10.248/scripts/properties_device.py
def onShowPropsDFP(t):
ide.addPropCategory(t,"diagnostics" , "*|toolpack", "Diagnostics")
ide.addBooleanProperty(t,"script.reset_by_pin" , "*|diagnostics|*","Use RESET pin instead of AIRCR reset","Normally unchecked. Check to reset using the RST pin instead of AIRCR", False)
|
共1人点赞
|