PSoC™ 6 Forum Discussions
Hi all,
I have a very interesting problem that I havent been able to solve for days. I have two different computers and they are setup to be the same.
On one computer, the RX FIFO buffer (RX_FIFO_RD) can be corrected referenced to /mtb_shared/mtb-pdl-cat1/release-v3.7.0//devices/COMPONENT_CAT1A/include/ip/cyip_scb.h. It builds compiles and runs.
On the second computer, the same RX_FIFO_RD cannot be resolved, and asks me to select which header to use cyip_ble.h, cyip_i2c.h and cy_scb.h from COMPONENT_CAT1A, COMPONENT_CAT1B or COMPONENT_CAT1C. It seems that it just cant make the link to the correct header after using 'Device Configurator'.
I cannot for the life of me find out why this isn't working properly on the second computer. Thanks for your help
Code snippet is below:
void configure_rx_dma(uint32_t* buffer_a, uint32_t* buffer_b, cy_stc_sysint_t* int_config)
{
cy_en_dma_status_t dma_init_status;
const cy_stc_sysint_t intRxDma_cfg =
{
.intrsrc=sRx0_IRQ,
.intrPriority = 7u
};
// -------------------------------------------------------------------------------------------------
// SCB0 Slave 0
// -------------------------------------------------------------------------------------------------
/* Initialize SCB0 descriptor 1 */
dma_init_status = Cy_DMA_Descriptor_Init(&sRx0_Descriptor_0, &sRx0_Descriptor_0_config);
if (dma_init_status!=CY_DMA_SUCCESS)
{
handle_error();
}
/* Initialize SCB0 descriptor 2 */
dma_init_status = Cy_DMA_Descriptor_Init(&sRx0_Descriptor_1, &sRx0_Descriptor_1_config);
if (dma_init_status!=CY_DMA_SUCCESS)
{
handle_error();
}
// Initialise DMA channel 20 (corresponds to SCB2 rx)
dma_init_status = Cy_DMA_Channel_Init(sRx0_HW, sRx0_CHANNEL, &sRx0_channelConfig);
if (dma_init_status!=CY_DMA_SUCCESS)
{
handle_error();
}
/* Set for (SCB0) source and destination address for descriptor 1 */
Cy_DMA_Descriptor_SetSrcAddress(&sRx0_Descriptor_0, (uint32_t *) &sSPI0_HW->RX_FIFO_RD);
Cy_DMA_Descriptor_SetDstAddress(&sRx0_Descriptor_0, (uint32_t *) buffer_a);
/* Set for (SCB0) source and destination address for descriptor 2 */
Cy_DMA_Descriptor_SetSrcAddress(&sRx0_Descriptor_1, (uint32_t *) &sSPI0_HW->RX_FIFO_RD);
Cy_DMA_Descriptor_SetDstAddress(&sRx0_Descriptor_1, (uint32_t *) buffer_b);
// All the lines above sets stuff for the descriptor structure
// The follow line sets the current(starting) DMA descriptor state, so will start with descriptor 0
Cy_DMA_Channel_SetDescriptor(sRx0_HW, sRx0_CHANNEL, &sRx0_Descriptor_0);
/* Initialize and enable interrupt from RxDma */
Cy_SysInt_Init(int_config, &rx_dma_complete); // system interrupt for CPU
NVIC_EnableIRQ(int_config->intrSrc);
/* Enable DMA interrupt source. */
Cy_DMA_Channel_SetInterruptMask(sRx0_HW, sRx0_CHANNEL, CY_DMA_INTR_MASK);
/* Enable channel and DMA block to start descriptor execution process */
Cy_DMA_Channel_Enable(sRx0_HW, sRx0_CHANNEL);
Cy_DMA_Enable(sRx0_HW);
}
我的application程序从外部将升级文件写到我分区的flash里,bootloader程序将升级文件搬移到application区。
但是如何实现跳转呢?有跳转函数的设计可以参考吗?
Hello Community,
I have a project with both .c and .cpp files and would like to force the modustoolbox to use g++ compiler to compile the .c files. When I make the change in the <Project>->Properties->C/C++ Build->Settings->C compiler = g++ (originally gcc); this change is not taking affect. Any idea why this wouldn't work? Is there any step I'm missing?
Any suggestions would be helpful.
Thank you.
Show Less
Hi everyone,
I'm reaching out because I'm new to C and C++ programming and the I2C protocol, and I'm facing a challenge with the code I've written.
I'm working on a project that involves I2C sensors, and I'm having trouble with my code for scanning I2C devices. Even after checking my wiring, I'm not getting the correct sensor addresses.
I suspect the issue might be in my code due to my limited experience. If you have knowledge in this area and can provide some guidance or suggestions, I would greatly appreciate your help.
Here's the code I'm using:
#include "cyhal.h"
#include "cybsp.h"
#include "cy_retarget_io.h"
#include <assert.h>
#include <stdio.h>
cyhal_i2c_t mI2C;
void i2cScannerMSB()
{
printf("\nI2C Device Scanner\n\n");
printf("Scanning...\n");
for (uint8_t i2caddress = 1; i2caddress < 127; i2caddress++)
{
cy_rslt_t rval;
uint8_t buffer[1];
rval = cyhal_i2c_master_write(&mI2C, (i2caddress << 1), buffer, 1, 0, false);
if (rval == CY_RSLT_SUCCESS)
{
printf("Device found at address: 0x%02X\n", i2caddress);
}
else
{
printf("No device at address: 0x%02X (Error: %ld)\n", i2caddress, rval);
}
printf("\nScan Complete\n");
}
}
int main(void)
{
cy_rslt_t result;
cyhal_i2c_cfg_t mI2C_cfg;
result = cybsp_init();
assert(result == CY_RSLT_SUCCESS);
// Initialize retarget-io only once
result = cy_retarget_io_init(CYBSP_DEBUG_UART_TX, CYBSP_DEBUG_UART_RX, CY_RETARGET_IO_BAUDRATE);
assert(result == CY_RSLT_SUCCESS);
printf("\x1b[2J\x1b[;H");
mI2C_cfg.is_slave = false;
mI2C_cfg.frequencyhal_hz = 100000; // Replace with your desired frequency (e.g., 100 kHz)
result = cyhal_i2c_init(&mI2C, CYBSP_I2C_SDA, CYBSP_I2C_SCL, NULL);
assert(result == CY_RSLT_SUCCESS);
printf("I2C Device Scanner\n");
printf("Press 'M' for MSB to scan for devices\n");
while (1)
{
char c = getchar();
switch (c)
{
case 'M':
i2cScannerMSB();
break;
}
}
}
Here is the results I have :
And Here is the results I should have :
*Note that for the second picture, I have used the arduino example i2c scanner.
Any insights or advice you can offer would be incredibly helpful to me.
Thank you !
Show Less
I will be using a 32MHz crystal oscillator to create a clock for the ECO clock circuit, on my CY8C6144AZI-S4F92.
The datasheet https://nl.mouser.com/datasheet/2/196/Infineon_PSoC_6_MCU_CY8C61X4_DataSheet_v06_00_EN-3166959.pdf states on page 13 that 2 load capacitors have to be used.
The values of these have to be half the load capacitance of the chosen crystal, in my case 8pF.
But the TRM https://www.infineon.com/dgdl/Infineon-PSoC_6_MCU_CY8C61x4_CY8C62x4_Architecture_Technical_Reference_Manual_PSoC_61_PSoC_62_MCU-AdditionalTechnicalInformation-v04_00-EN.pdf?fileId=8ac78c8c7ddc01d7017ddd027dfa590b&utm_source=cypress&utm_medium=referral&utm_campaign=202110_globe_en_all_integration-files states that the hardware design considerations document https://www.infineon.com/dgdl/Infineon-AN218241_PSoC_6_MCU_Hardware_Design_Considerations-ApplicationNotes-v10_00-EN.pdf?fileId=8ac78c8c7cdc391c017d0d314a0f653f&utm_source=cypress&utm_medium=referral&utm_campaign=202110_globe_en_all_integration-application_note must be used.
This document states on page 13 that the load capacitance value should be C = 2 × (CL − CS) − CP. This will return a different value.
Which should i use?
Show LessI want to set the value to CTDAC_VAL register from a status register via DMA.
I wrote,
Cy_DMA_Descriptor_SetSrcAddress(&DMA_Descriptor_1, (void *)Status_Reg_1_sts_sts_reg__STATUS_REG);
Cy_DMA_Descriptor_SetDstAddress(&DMA_Descriptor_1, (uint32_t *)&(CTDAC0->CTDAC_VAL));
but it couldn't work.
What is the appropriate argument in the functions "Cy_DMA_Descriptor_SetSrcAddress" and " Cy_DMA_Descriptor_SetDstAddress" in this case ?
Show LessHi, Friend
I am using Nor Flash of W25N01GWZEIG, unfortunately, it is not in the list of QSPI configurator. Do you know where is its memory configuration file or I can choose another model number to proceed. BTW, use auto detect does not work. Thanks in advance.
Victor
Show LessHello!
I am having BLE problem on PSoC 6
"ChuoiData3" is having trouble updating new values!
I tried changing "ChuoiData2" and the value is still updated continuously!
I used AIROC app to check, but the value of "ChuoiData3" is still not updated
I can't find the cause
Can someone help me?
Thank you!
Hello!
I have a project reading the MHZ19B sensor on PSoC 6
Specifically, I use UART to read the sensor and use UART_1 to display on the PC (Tera Term)
I'm getting an error and don't know how to fix it!
Hope to receive help from you!
Thank you very much