Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using CMSIS-Driver with ESP8266 on STM32H743XIH6 encounters errors #38

Open
QingshuangZhu opened this issue Jan 20, 2025 · 4 comments
Open

Comments

@QingshuangZhu
Copy link

I'm experiencing an issue where ARM_WIFI_PowerControl(ARM_POWER_FULL) -> SetupCommunication() -> WiFi_Wait() returns -1, indicating a response timeout error, when using version 1.8.0. What could be the cause of this?

@MiloradCvjetkovic
Copy link
Collaborator

Hi @QingshuangZhu,

can you provide a little bit more information about your setup?

Do you have sparkfun ESP8266 WiFi module or something else?
Are you using an STM32H7 evaluation board or a custom hardware?

For some general suggestions you can check the the following information, suggesting importance of proper RESET connection and external power supply of the shield.

@QingshuangZhu
Copy link
Author

QingshuangZhu commented Jan 21, 2025

Thank you very much for your reply.
I am using custom hardware along with the espressif ESP8266 WiFi module. As a beginner, I am not quite familiar with how to configure pinout using STM32 CubeMX. As shown in the figure below, the Power and Thermal settings have not been configured.

Image

The WiFi_ESP8266_Config.h file is as follows.

/* -----------------------------------------------------------------------------
 * Copyright (c) 2019 Arm Limited (or its affiliates). All rights reserved.
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Licensed under the Apache License, Version 2.0 (the License); you may
 * not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 *
 * $Date:        12. November 2019
 * $Revision:    V1.0
 *
 * Project:      ESP8266 WiFi Driver
 * -------------------------------------------------------------------------- */

//-------- <<< Use Configuration Wizard in Context Menu >>> --------------------

// <h>ESP8266 WiFi Driver Configuration

// <o> WiFi Driver Number (Driver_WiFi#) <0-255>
// <i> Defines exported WiFi driver control block number (Driver_WiFi#)
// <i> Default: 0
#define WIFI_ESP8266_DRIVER_NUMBER          0

// <o>Connect to hardware via Driver_USART# <0-255>
// <i>Defines the serial driver control block number (Driver_USART#)
// <i> Default: 0
#define WIFI_ESP8266_SERIAL_DRIVER          1

// <o> Serial interface baudrate <115200=>115200
//                               <230400=>230400
//                               <460800=>460800
//                               <921600=>921600
// <i> Defines the serial interface baudrate.
// <i> Default: 115200
#define WIFI_ESP8266_SERIAL_BAUDRATE        115200

// <o> WiFi thread priority <0=>osPriorityLow
//                          <1=>osPriorityBelowNormal
//                          <2=>osPriorityNormal
//                          <3=>osPriorityAboveNormal
//                          <4=>osPriorityHigh
//                          <5=>osPriorityRealtime
// <i> Defines the WiFi driver thread priority.
// <i> The priority of the WiFi thread should be higher as application thread priority.
// <i> Default: 3
#define WIFI_ESP8266_THREAD_PRIORITY        3

// <o> WiFi thread stack size [bytes] <96-1073741824:8>
// <i> Defines stack size for the WiFi Thread.
// <i> Default: 512
#define WIFI_ESP8266_THREAD_STACK_SIZE      512

// <o> Socket buffer block size <128-16384:128>
// <i> Defines the size of one memory block used for socket data buffering.
// <i> Socket buffering consists of multiple blocks which are distributed across multiple sockets.
// <i> Default: 512
#define WIFI_ESP8266_SOCKET_BLOCK_SIZE      512

// <o> Socket buffer block count <5-256>
// <i> Defines the total number of memory blocks used for socket data buffering.
// <i> Socket buffering consists of multiple blocks which are distributed across multiple sockets.
// <i> Default: 8
#define WIFI_ESP8266_SOCKET_BLOCK_COUNT     8

// <o> Serial parser buffer block size
// <i> Defines the size of one memory block in serial parser buffer.
// <i> The total size of serial parser buffer is defined by memory block size and number of blocks.
// <i> Default: 256
#define WIFI_ESP8266_PARSER_BLOCK_SIZE      256

// <o> Serial parser buffer block count
// <i> Defines the number of memory blocks in serial parser buffer.
// <i> The total size of serial parser buffer is defined by memory block size and number of blocks.
// <i> Default: 8
#define WIFI_ESP8266_PARSER_BLOCK_COUNT     8

// </h>

//------------- <<< end of configuration section >>> -------------------------

@MiloradCvjetkovic
Copy link
Collaborator

Hi @QingshuangZhu,

thanks for the explanation, it is much clearer now.

Anyways, I would suggest you take a look at support for a similar board that we already have.

We have support for a board NUCLEO-H743ZI2 that has a H743 MCU (different variant than XIH6 but similar enough) and you can find that BSP development at the following GitHub repository https://github.com/Open-CMSIS-Pack/ST_NUCLEO-H743ZI2_BSP .

You can also find a BSP (Board Support Pack) pack at the following link: https://www.keil.arm.com/packs/nucleo-h743zi2_bsp-keil/overview/ .

What you will be interested in, is how this chip is configured by the STM32CubeMX so you can make similar configuration in your STM32CubeMX and the .ioc file that you can inspect is located in the previously mentioned GitHub repository, specifically at the following location https://github.com/Open-CMSIS-Pack/ST_NUCLEO-H743ZI2_BSP/blob/main/Layers/Default/CubeMX/STM32CubeMX/STM32CubeMX.ioc .

Now, this is all something that can help you, there is, however, a lot of information you have to digest, you can start with what are CMSIS components and about CMSIS-Toolbox and CubeMX generator .

@QingshuangZhu
Copy link
Author

Hi @MiloradCvjetkovic,
thank you very much for your help, i will follow your advice and learn.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants