Analog Devices为无操作系统系统提供的软件驱动程序
立即下载
资源介绍:
adi 生产的产品的驱动软件层,可用于 stm32、esp32 等微控制器编程使用,可以大大节省开发时间。
# Prerequisites
Prior to building the project, a couple steps are necessary in order to get the Maxim Micros SDK and setup the environment. These are presented in the ***Build Prerequisites*** section of no-OS build guide available here: https://wiki.analog.com/resources/no-os/build .
The MaximSDK provides distributions of `arm-none-eabi-` GCC compiler + utilities and `OpenOCD`, so you don't have to install these separately.
# Overview
Currently, this project offers 2 firmware examples meant to run on the AD-SWIOT1L-SL board:
- The first one is based on the IIO framework. It may be used in combination with Scopy (+ the SWIOT1L plugin) or any other IIO client (such as pyadi-iio). This will be referred to as "SWIOT1L default firmware".
- The other one showcases how you may send data over MQTT to a remote broker connected over the 10Base-T1L port. This will be referred to as "SWIOT1L MQTT firmware".
# Building the SWIOT1L default firmware
This is only intended to be run on the MAX32650 target.
1. Open a terminal and navigate to this project directory (if building on Windows, `Git Bash` has to be used). Please remember that switching between the firmware examples requires you to clean the previous build artifacts. You may do this by running `make reset`.
2. Type `make RELEASE=y SWIOT1L_STATIC_IP=y -j`, in order to build the project. You may leave out the `SWIOT1L_STATIC_IP=y` flag if you want the IP to be assigned using DHCP. The `RELEASE` flag adds `-O2` optimization and is optional, but without it, the MCU won't be able to keep up with the AD74413R's sampling rate, and some samples will be lost. So, it should only be omitted during debugging.
A successful build should end with the following terminal output:
```
[11:11:27] [HEX] swiot1l.hex
[11:11:27] swiot1l.hex is ready
rm /home/xvr/MaximSDK_new/Libraries/CMSIS/Device/Maxim/MAX32650/Source/GCC/startup_max32650.s
[11:11:21] Done (build/swiot1l.elf)
```
# Building the SWIOT1L MQTT firmware
This is only intended to be run on the MAX32650 target.
1. Open a terminal and navigate to this project directory (if building on Windows, `Git Bash` has to be used). Please remember that switching between the firmware examples requires you to clean the previous build artifacts. You may do this by running `make reset`.
2. Type `make RELEASE=y SWIOT1L_STATIC_IP=y SWIOT1L_MQTT_EXAMPLE=y SWIOT1L_DEFAULT_FW=n -j`, in order to build the project. The `RELEASE` flag adds `-O2` optimization and is optional, but without it, the MCU won't be able to keep up with the AD74413R's sampling rate, and some samples will be lost. So, it should only be omitted during debugging.
A successful build should end with the following terminal output:
```
[11:11:27] [HEX] swiot1l.hex
[11:11:27] swiot1l.hex is ready
rm /home/xvr/MaximSDK_new/Libraries/CMSIS/Device/Maxim/MAX32650/Source/GCC/startup_max32650.s
[11:11:21] Done (build/swiot1l.elf)
```
The binary and executable files are now available in the `build` directory (`swiot1l.hex` and `swiot1l.elf` files).
# Programming the MCU
Before the MCU can be programmed a few steps are necessary:
1. Replace the DAPLINK firmware for the MAX32625PICO. This is only required to be done one time.
- Download the firmware image from the following link: https://github.com/MaximIntegrated/max32625pico-firmware-images/raw/master/bin/max32625_max32650fthr_if_crc_swd_v1.0.6.bin .
- Make sure the MAX32625PICO is not connected to the PC.
- Press the button on the MAX32625PICO, and keep it pressed while you plug the USB cable in the MAX32625PICO.
- Release the button once you can see a `MAINTENANCE` drive being mounted.
- Copy the firmware binary file to the `MAINTANANCE` drive. It should unmount and a `DAPLINK` drive should appear instead.
2. Connect the MAX32625PICO board to the PC and the SWIOT1L board. If everything went well, you should see a mass storage device named `DAPLINK` in your filesystem.
3. Power on the SWIOT1L board, by providing 24V to the power connector.
The microcontroller may be programmed in 2 ways:
1. Drag-and-drop the binary (.hex) file in the `DAPLINK` directory. The drive should be unmounted and mounted again, once the programming is done.
2. While in the project's root directory, type `make RELEASE=y run` (you should keep the flags used to build the project). This method uses OpenOCD in order to load the binary file. If the programming is successful, you should see the following terminal output:
```
** Programming Started **
** Programming Finished **
** Verify Started **
** Verified OK **
** Resetting Target **
shutdown command invoked
[11:27:42] swiot1l.elf uploaded to board
```
# Network connection for the SWIOT1L default firmware
In order to configure and sample data from the SWIOT1L board, you'll have to connect it to a PC through the single pair Ethernet connector. There are a couple ways to do it:
1. Using a T1L -> Ethernet media converter:
- Direct connection to PC:
Build the firmware with the `SWIOT1L_STATIC_IP=y` flag, will result in using `192.168.97.40` as an IP address. This is the fastest way of testing the platform, since it doesn't require the DHCP configuration or DHCP timeout (in case of AutoIP).
Alternatively, you may omit `SWIOT1L_STATIC_IP=y` (or set it to `n`), in which case, the board will send a DHCP request and try to get an IP that way. If you don't have a DHCP server listening on the PC's network interface (to which SWIOT1L is connected), a link local address (in the 169.254.x.x\16 range) will be used. This may take a while (~10s) the first time you power the board, since there have to be 2 failed DHCP requests.
In case a link local or static IP address is used for the AD-SWIOT1L-SL, the user may need to manually add a static IP for their PC's network interface which connects to the board. You may do this by going through the following guide https://wiki.analog.com/resources/no-os/misc_guides/static_ip_setting?rev=1715173602 (and choosing an IP in the same subnet as the AD-SWIOT1L-SL board: e.g 192.168.97.1/24).
```mermaid
graph LR
A[SWIOT1L's SPE connector] -- SPE --> B[T1L -> Ethernet media converter]
B -- Ethernet --> D[PC]
```
- Connection through a router:
In this case, you'll most likely have a DHCP server running on your router, which will assign an IP to your board.
```mermaid
graph LR
A[SWIOT1L's SPE connector] -- SPE --> B[T1L -> Ethernet media converter]
B -- Ethernet --> C[Router]
D[PC] -- Ethernet --> C[Router]
```
1. Using a T1L -> USB media converter:
```mermaid
graph LR
A[SWIOT1L's SPE connector] -- SPE --> B[T1L -> USB media converter]
B -- USB --> D[PC]
```
After the hardware connections are made, you'll have to power cycle the board.
In all these cases, once the TCP/IP software stack is fully configured and the board has an IP assigned to it (this will take ~10s if there is no DHCP server and the `SWIOT1L_STATIC_IP` flag is not set to `y`), the IP, network mask and gateway will be output to the serial interface (baudrate 115200 8N1).
Next, just to make sure that you can communicate with the board, you can try to ping the it using the IP address previously mentioned (either from command line or terminal).
In case the the ping resulted in a "destination unreachable" error, it may be the case that the PC's network interface is not correctly configure to route packets to the board's IP.
# Network connection for the SWIOT1L MQTT firmware
Directly connect the AD-SWIOT1L-SL board to your PC using a SPE -> Ethernet/USB media converter.
By default, the firmware will try to connect to the 192.168.97.1 IP, port 1883. So, you'll need to have an MQTT broker running on the host PC. The broker should listen for connections on an interface which has the 192.168.97.1 IP configured. The IP and port settings may be changed by setting different value to the `SWIOT1L_MQTT_SERVER_IP` and `SWIOT1L_MQTT_SERVER_PORT` make variables when compiling.
The MQTT protocol version used by the AD-SWIOT1L-SL is V3.1.1. The connection is not us
资源文件列表:
no-OS-main.zip 大约有5537个文件