Timer Interrupt Not Working On a Custom BSP (based off CY8CKIT-062-WIFI-BT)

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
JoCh_1493306
Level 3
Level 3
25 sign-ins 10 replies posted 10 questions asked

Hi,

I have a custom BSP created based off CY8CKIT-062-WIFI-BT. I copied the timer interrupt code from the "Hello World" example (which blinks a LED when a timer interrupt occurs), and tried to run that on my custom BSP. The project built ok and loaded to my board ok. However, I don't see the timer interrupt being generated when it runs. Below is my Device Configurator Systems page.

The only change I made was to disable WCO (and changed CLK_BAK to CLK_LF, an changed CLK_LF to use the source from ILO). The reason of disabling WCO was due to some run-time error I ran into in cybsp_init() function (the error seems to relate to WCO not configured since this is a custom board). After disabling WCO it was running ok.

However, now I am testing the timer interrupt code like in the "Hello World" example project, it doesn't seem to me the timer interrupt was happening at all (in the ISR, I have a LED blink function call and a printf(), but I did not see any of them happen).

pastedImage_0.png

FYI I also disabled some pin functions in Device Configurator since they conflict with my custom board's actual routing (I used HAL in my code). I can see P0[0] and P0[1] are used by WCO. If I disabled them it would give me error.

pastedImage_1.png

So here I have 2 questions:

1. What did I miss in my project causing the timer interrupt not working?

2. How do I configure WCO correctly for the custom board?

************************ Edited on 11/16 *********************

I have attached a project which does not have the timer interrupt working in this moment.

1. I created this project based off CY8CKIT-062-WIFI-BT "Hello World" example, and verified it worked well on the dev kit (LED was blinking ok by the timer interrupt)

2. Then I created the custom BSP (TESTBSP1) from this project. I modified the UART and LED pin assignment to match what I have on the custom board. I did not change the code at all. It still works fine on my custom board.

3. I need to enable the Wi-Fi feature on my custom board, so I added in "wifi-connection-manager" library from "Library Manager 1.2" (which also includes lots of other libraries, such as freertos). I also copied resource_map.h, FreeRTOSConfig.h, lwipopts.h, and mbedtls_user_config.h files to the project folder. Made changes to the makefile by modifying the variables below:

COMPONENTS=FREERTOS PSOC6HAL LWIP MBEDTLS 4343W

DEFINES+=MBEDTLS_USER_CONFIG_FILE='"mbedtls_user_config.h"'

DEFINES+=CYBSP_WIFI_CAPABLE

DEFINES+=CY_RTOS_AWARE

I also copied wifi_nvram_image.h from TARGET_CY8CKIT-062-WIFI-BT folder to TARGET_TEST_BSP1 folder in order to get Wi-Fi feature enabled.

The code was then built ok and loaded to my custom board ok. However, the timer interrupt stops working this time.

So it looks like adding those Wi-Fi libraries messed up with the timer interrupt. Any idea how to fix that?

Thanks!

0 Likes
1 Solution
Murali_R
Moderator
Moderator
Moderator
250 sign-ins 250 replies posted 100 solutions authored

JoCh_1493306 The issue as to why the timer interrupts weren't getting triggered after adding the FreeRTOS library was because of the timer interrupt priority. This should be higher than the  configMAX_SYSCALL_INTERRUPT_PRIORITY used in the FreeRTOSconfig.h If this is not the case, then the timer interrupt gets masked by the FreeRTOS kernel. You should get some more information on this here FreeRTOS - The Free RTOS configuration constants and configuration options - FREE Open Source RTOS f... and in the FreeRTOS community and website.

Thanks

View solution in original post

5 Replies
Murali_R
Moderator
Moderator
Moderator
250 sign-ins 250 replies posted 100 solutions authored

JoCh_1493306 What is the version of modus that is being used?

0 Likes

I use ModusToolbox Version 2.2

0 Likes
Murali_R
Moderator
Moderator
Moderator
250 sign-ins 250 replies posted 100 solutions authored

JoCh_1493306 The issue is not with the WiFi libraries but with how FreeRTOS' libraries and the timers are interacting is my intuition at the moment. Trying to find some solid documentation and reasons as to why this maybe the case.

In the meanwhile can you you use a software timer using xTimerCreate or create a task and use a delay function inside it and use it with your application. This should work.

0 Likes

Hi, you are right, I used Freertos xTimerCreate function and it works after the scheduler started. So seems like when Freertos library is included, some Cypress functions are disabled for some reason. Yeah if you can share with me some documents on that, it would be great! Thank you!

0 Likes
Murali_R
Moderator
Moderator
Moderator
250 sign-ins 250 replies posted 100 solutions authored

JoCh_1493306 The issue as to why the timer interrupts weren't getting triggered after adding the FreeRTOS library was because of the timer interrupt priority. This should be higher than the  configMAX_SYSCALL_INTERRUPT_PRIORITY used in the FreeRTOSconfig.h If this is not the case, then the timer interrupt gets masked by the FreeRTOS kernel. You should get some more information on this here FreeRTOS - The Free RTOS configuration constants and configuration options - FREE Open Source RTOS f... and in the FreeRTOS community and website.

Thanks