Please tell me how to check the operation of SURF5.
MCU & Boards
No replies yet. Be the first to reply.
Join the discussion.
MCU & Boards
No replies yet. Be the first to reply.
Join the discussion.
Share projects and connect with makers.
Joined before the site update? first.
New to WIZnet Makers?
We sent a verification link to your address. Open it to activate your account, then log in.
Accounts from this email provider are reviewed by an administrator after verification. Approval usually takes one business day.
Already have an account?
Enter your email address. If it belongs to an account, we'll send a link to set a new password. Members who joined before the site update use this to set their password.
If an account uses that address, we sent a link to set a new password. The link works once and expires in 30 minutes.
Know your password?
Need an account?
RE: Please tell me how to check the operation of SURF5.
by WIZnet AI AI generated ·
RE: RE: Please tell me how to check the operation of SURF5.
by qtsn64 ·
I confirmed in the circuit diagram that the LED is connected to the 8th pin (PC_15).
I have confirmed that it is set to GPIOC, GPIO_Pin_15 in GPIO_Interrupt, so I believe it is connected to the appropriate GPIO pin.
Can the LED connected to PC_15 be lit even if the power is supplied by USB power supply instead of PoE power supply?
Also, is there a way to visually check whether it is in boot mode or the program is running?
RE: Please tell me how to check the operation of SURF5.
by TheoIm WIZnet ·
Hello, First, check if printf outputs correctly when initializing the Surf 5 for the first time. If UART data is printed through printf, the issue is likely related to GPIO initialization. Please provide the code.
RE: RE: Please tell me how to check the operation of SURF5.
by qtsn64 ·
Hello. Thank you for your response.
Here is the code. Since I just want to light up the LED, I have disabled the interrupt-related processing. Other than this, I am using the "W7500x-StdPeriph_Examples" as it is.
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/* Includes ------------------------------------------------------------------*/
#include "main.h"
/** @addtogroup W7500x_StdPeriph_Examples
* @{
*/
/** @addtogroup GPIO_Interrupt
* @{
*/
/* Private function prototypes -----------------------------------------------*/
static void UART_Config(void);
static void GPIO_Config(void);
/* Private functions ---------------------------------------------------------*/
/**
* @brief Main program.
* @param None
* @retval None
*/
int main(void)
{
SystemInit();
UART_Config();
GPIO_Config();
printf("W7500x Standard Peripheral Library version : %d.%d.%d\r\n", __W7500X_STDPERIPH_VERSION_MAIN, __W7500X_STDPERIPH_VERSION_SUB1, __W7500X_STDPERIPH_VERSION_SUB2);
printf("SourceClock : %d\r\n", (int) GetSourceClock());
printf("SystemClock : %d\r\n", (int) GetSystemClock());
printf("System Loop Start\r\n");
GPIO_SetBits(GPIOC, GPIO_Pin_15);
while (1) {
GPIO_ResetBits(GPIOC, GPIO_Pin_15);
for(int i=0; i < 1000000; i++);
GPIO_SetBits(GPIOC, GPIO_Pin_15);
}
return 0;
}
/**
* @brief Configures the UART Peripheral.
* @note
* @param None
* @retval None
*/
static void UART_Config(void)
{
UART_InitTypeDef UART_InitStructure;
UART_StructInit(&UART_InitStructure);
#if defined (USE_WIZWIKI_W7500_EVAL)
UART_Init(UART1, &UART_InitStructure);
UART_Cmd(UART1, ENABLE);
#else
S_UART_Init(115200);
S_UART_Cmd(ENABLE);
#endif
}
/**
* @brief Configures the GPIO Peripheral.
* @note
* @param None
* @retval None
*/
static void GPIO_Config(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
//GPIO_ITInitTypeDef GPIO_ITInitStructure;
//NVIC_InitTypeDef NVIC_InitStructure;
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_15;
GPIO_InitStructure.GPIO_Direction = GPIO_Direction_OUT;
GPIO_InitStructure.GPIO_Pad = GPIO_OpenDrainDisable | GPIO_HighDrivingStrength | GPIO_PuPd_NOPULL;
GPIO_InitStructure.GPIO_AF = PAD_AF1;
GPIO_Init(GPIOC, &GPIO_InitStructure);
GPIO_SetBits(GPIOC, GPIO_Pin_15);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4;
GPIO_InitStructure.GPIO_Direction = GPIO_Direction_IN;
GPIO_InitStructure.GPIO_Pad = GPIO_InputBufferEnable | GPIO_CMOS | GPIO_PuPd_UP;
GPIO_InitStructure.GPIO_AF = PAD_AF1;
GPIO_Init(GPIOC, &GPIO_InitStructure);
/*GPIO_ITInitStructure.GPIO_IT_Pin = GPIO_Pin_4;
GPIO_ITInitStructure.GPIO_IT_Polarity = GPIO_IT_HighRising;
GPIO_ITInitStructure.GPIO_IT_Type = GPIO_IT_Edge;
GPIO_IT_Init(GPIOC, &GPIO_ITInitStructure);
GPIO_ITConfig(GPIOC, GPIO_Pin_4, ENABLE);
NVIC_InitStructure.NVIC_IRQChannel = PORT2_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPriority = 0x0;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);*/
}
#ifdef USE_FULL_ASSERT
/**
* @brief Reports the name of the source file and the source line number
* where the assert_param error has occurred.
* @param file: pointer to the source file name
* @param line: assert_param error line source number
* @retval None
*/
void assert_failed(uint8_t* file, uint32_t line)
{
/* User can add his own implementation to report the file name and line number,
ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
/* Infinite loop */
while (1)
{
}
}
#endif
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Firstly, when I initialize SURF5, Printf does not output anything. I am using Teraterm as the serial console for output. I have checked the serial port settings such as baud rate, and there seems to be no mistake.
Since Printf does not output anything, I suspect that the binary file generated after the build might be abnormal. For example, when I compared the binary files of UART_Printf.bin and GPIO_Interrupt.bin, their contents were exactly the same.
If you have any insights based on this information, I would appreciate it if you could let me know.
RE: RE: Please tell me how to check the operation of SURF5.
by qtsn64 ·
Hello. I apologize for posting again so soon, but I was struggling so much that I switched my development environment from VSCode to Keil, and it resolved the issue.
Although I followed the steps for VSCode as stated on WIZnet's official website, I still don't know what settings were wrong...