PSoC™ 6 Forum Discussions
I am trying to set up CE217639 Heart Rate Client, and Heart Rate Server examples.
Only modification is I changed the Device to CY8C6347BZI-BLD54. When I run either example it gets stuck on Cy_BLE_Start(NULL); in main_cm0p.c
Chasing it down it goes into BLE.c, and gets stuck on the function apiResult = Cy_BLE_Enable();
This goes to cy_ble.c and gets stuck in apiResult = Cy_BLE_StackInit(&stackInitParam);
I have also tried CE217643 BLE Temperature Measurement and it gets stuck in the same place.
Any ideas why these examples are not working for me?
Show Less
Hello All,
In my latest project I have implemented a bootloader using the DFU source code. I have changed from using a UART/SPI to some NVM that requires a PLL in order to copy my app1 onto the flash and this part of my project works well. My issues arises once I switch into my app1. I use the Debug-> Attach to running target in order to test my app1. It seems to be getting stuck in the ClockInit function in cyfitter_cfg.c where it does:
status = Cy_SysClk_PllManualConfigure(1u, &pllConfig);
I have found a small patch for my issue by adding in:
Cy_SysClk_PllDisable(1u);
Onto the line directly before configure line and this seems to fix my problem. However, this is from the PSoC generated source (I believe) so if any top design changes are made I would have to re-enter this line to allow my code to work again. I know there is the CyClockStartupError function which contains
CY_CFG_Clock_Startup_ErrorCallback();
Which looks like a possible solution to my problem but I have no clue how to implement that functionality there or if it is the correct spot.
To summarize:
When I use a PLL on app0 and app1, app1 will lock unless I disable the PLL before starting it. I have tested it and the patch works but I don't know how to implement it such that it doesn't disappear when I need files regenerated. Could anybody give me some advice or direction as to how I should proceeded or what documentation to look at in order to implement this correctly?
Thanks!
Show LessI have code that runs just fine with 2 tasks for a random amount of time and then I get a UsageFault. The time to the fault ranges from a few minutes to a few hours, so is very hard to determine what is causing the fault. Any suggestions on how to figure out what is wrong? Stack trace attached. Thanks!
Show Less
Hi,
So in my previous question, I could manage to measure interval of external IRQ signal.
https://community.cypress.com/t5/PSoC-6-MCU/PSoC-6-Measuring-IRQ-interval/m-p/279015#M10056
But then the customer wants to use a PSoC 6 without UDB. >_<
So I changed the strategy to get the capture value in the ISR,
and take care of the handling from software.
I changed the schematic something like
And in the ISR I "tried" to clear interrupt flag as below
void sensor_irq1_isr(void)
{
uint32_t source ;
source = Counter_1_GetInterruptStatus() ;
if ((source & CY_TCPWM_INT_ON_CC) != 0) {
Pin_2_Write(1) ;
sensor1_period = Counter_1_GetCapture() ;
sensor1_flag = 1 ;
}
NVIC_ClearPendingIRQ(SysInt_1_cfg.intrSrc) ;
Cy_TCPWM_ClearInterrupt(Counter_1_HW, Counter_1_CNT_NUM, source) ;
// Counter_1_Disable() ;
}
But this ISR seems to be called repeatedly.
The upper yellow signal is from CY8CKIT-044.
The lower purple signal is written to 1 inside ISR and cleared in the main loop.
So although I'm expecting seeing only 1 pulse around the falling edge of the input signal,
my CY8CKIT-062-BLE has been generating interrupts repeatedly.
I spent whole day today, but in vain. (T^T)
Probably I'm missing or misunderstanding something...
Now my question is what is the proper method to clear interrupt of TCPWM (Capture)
and reload the counter (TCPWM) to count next interval?
main_cm4.c
#include "project.h"
#include "stdio.h"
#include "tty_utils.h"
volatile int32_t sensor1_period = 0 ;
volatile int sensor1_flag = 0 ;
void Pin_2_Write(int v)
{
Cy_GPIO_Write(Pin_2_0_PORT, Pin_2_0_NUM, v) ;
}
void sensor_irq1_isr(void)
{
uint32_t source ;
source = Counter_1_GetInterruptStatus() ;
if ((source & CY_TCPWM_INT_ON_CC) != 0) {
Pin_2_Write(1) ;
sensor1_period = Counter_1_GetCapture() ;
sensor1_flag = 1 ;
}
NVIC_ClearPendingIRQ(SysInt_1_cfg.intrSrc) ;
Cy_TCPWM_ClearInterrupt(Counter_1_HW, Counter_1_CNT_NUM, source) ;
// Counter_1_Disable() ;
}
void sensor_irq1_init(void)
{
#if 0
const cy_stc_sysint_t SysInt_1_cfg = {
.intrsrc=(IRQn_Type)SysInt_1__INTC_NUMBER,
.intrPriority = SysInt_1__INTC_CORTEXM4_PRIORITY
} ;
#endif
Cy_SysInt_Init(&SysInt_1_cfg, sensor_irq1_isr) ;
NVIC_ClearPendingIRQ(SysInt_1_cfg.intrSrc) ;
NVIC_EnableIRQ((IRQn_Type)SysInt_1_cfg.intrSrc) ;
}
void init_hardware(void)
{
__enable_irq(); /* Enable global interrupts. */
Pin_2_Write(0) ;
tty_init() ;
sensor_irq1_init() ;
Counter_1_Start() ;
}
int main(void)
{
int32_t prev_period = -1 ;
int32_t period = 0 ;
int32 count = 0 ;
char fun[] = { '|', '/', '-', '\'' } ;
int fun_index = 0 ;
init_hardware() ;
cls() ;
splash("PSoC 6 Interval Timer Test") ;
// Counter_2_Start() ;
for(;;)
{
if (sensor1_flag) {
Pin_2_Write(0) ;
period = sensor1_period ;
sensor1_flag = 0 ;
Counter_1_TriggerReload() ;
// Counter_1_Enable() ;
#if 0
if (prev_period != period) {
snprintf(str, STR_BUF_LEN, "Sensor1: %d\n\r", period) ;
print(str) ;
prev_period = period ;
CyDelayUs(100) ;
} else {
count++ ;
if (count > 100) {
count = 0 ;
fun_index = (fun_index + 1) % 4 ;
snprintf(str, STR_BUF_LEN, "\b%c", fun[fun_index]) ;
print(str) ;
}
}
#endif
}
}
}
Any suggestions and/or corrections will be appreciated.
moto
Show Less2 Questions on PSoC 64:
1. Do we have ISO7816 driver to connect to a smart card
2. Do we have an Application note to implement Bulk Encryption/decryption in PSoC64?
Show LessThis is a follow up from https://community.cypress.com/t5/PSoC-6-MCU/MCWDT-Interrupt-not-working-as-Deep-Sleep-wakeup-source-in/td-p/120769. I work with @RaMu_4639021 and we're continuing to track down the same issue, but I can't reply on that post. Our idle thread looks roughly like:
uint32_t int_status = Cy_SysLib_EnterCriticalSection();
eSleepModeStatus eSleepStatus = eTaskConfirmSleepModeStatus();
if (eSleepStatus != eAbortSleep )
{
Cy_SysPm_DeepSleep(CY_SYSPM_WAIT_FOR_INTERRUPT);
}
Cy_SysLib_ExitCriticalSection(int_status);
It's important that interrupts remain disabled between the calls to eTaskConfirmSleepModeStatus and Cy_SysPm_DeepSleep(). However, if we execute Cy_SysPm_DeepSleep() in a critical section, the device will hang while executing Cy_BLE_DeepSleepCallback(). If we never start the BLE component (so the BLE component never registers a call back with Cy_SysPm_RegisterCallback()), then the device sleeps and wakes up as expected. Is it possible to configure Cy_BLE_DeepSleepCallback() so that it can be called in a critical section?
Show LessSorry to disturb everyone.
I encountered a difficult problem.
In Psoc6, how to configure the pins in port9 as SAR AD pins without generating DSI interrupts. What I configured will always generate DSI interrupts, so the program enters Cy_HALT() .
Thank you very much for your help
Show LessHi everyone, excuse me.
I have an urgent question.
After Modus is compiled, the RAM usage size will be displayed. I found that the same code, on modus, the heap usage is very large, but it is very small on other compilers, so that my SRAM on MODus is about to exceed.
Total Internal SRAM (Available) 292864
Total Internal SRAM (Utilized with heap) 279920
thanks for your help
Show LessHello,
I am using a CY8C6347BZI-BLD53 and ble connections are working well with iOS and Android clients. However, establishing a BLE connection with windows is unreliable; sometimes it works, some times it doesn't. I've used a protocol analyzer to capture the BLE traffic while establishing a connection with windows and have found that when a connection doesn't work, the PSoC6 doesn't acknowledge the LL_FEATURE_REQ sent by the windows radio and the windows radio retransmits that packet until the connection times out. What could cause this behavior?
I've attached a couple of screenshots of the packet trace showing the issue. Frame 8,308 is the connection indication and it is immediately followed by the LL feature request on frame 8,309. Frame 8310 doesn't acknowledge frame 8,309 and then it gets retransmitted a lot of times, never being acknowledged by the PSoC6. I'm happy to upload the full packet trace to a non-public forum, it contains both successful and unsuccessful connections.
Thanks,
Theo
Show Less