PSoC™ 6 Forum Discussions
I'm trying to setup a SPI TX by DMA, but I'm unable to trigger my DMA transaction (see more details here: Unable to properly setup DMA channels for SPI operation ).
I have my SPI TX FIFO level set to 1, which means that it should trigger the DMA as soon as it's empty. However, my DMA never gets triggered. So I'm wondering if the DMA would trigger on a level change (from low to high), or if it's enought that the condition is already true when I enable the DMA channel.
Show LessHi,
I need to setup my DMA transfers, but I'm not used to the X loops/Y loops nomenclature of the PSoC 6.
What I want is:
One SPI_TX_BUF_EMPTY interrupt to trigger one byte transfer by the TX DMA channel, for up to 512 bytes, then deactivate the channel.
One SPI_RX_BUF_NOT_EMPTY interrupt to trigger one byte transfer by the RX DMA channel, for up to 512 bytes, then deactivate the channel.
For this, I have setup:
SPI RX FIFO level = 0, rx output connected to RX_DMA input trigger
SPI TX FIFO level = 1, tx output connected to TX_DMA input trigger
DMA_RX
Trigger input type: One transfer per trigger
Trigger deactivation and triggering: Retrigger immediately (pulse trigger)
Data element size: Byte
Src and Dest width: byte to byte
X loop size = 1 // will be changed dynamically
X loop src inc = 0
X loop dst inc = 1
Y loop size = 1
Y loop src inc = 0
Y lop dst inc = 0
DMA_TX
Trigger input type: One transfer per trigger
Trigger deactivation and triggering: Retrigger immediately (pulse trigger)
Data element size: Byte
Src and Dest width: byte to byte
X loop size = 1 // will be changed dynamically
X loop src inc = 1 // will be changed dynamically
X loop dst inc = 0
Y loop size = 1
Y loop src inc = 0
Y lop dst inc = 0
I need to have a variable transaction size, thus I have the two following functions:
int8_t SpiDma_Write(uint8_t *buf, uint16_t len) {
if (len == 0) {
return -1;
}
NVIC_EnableIRQ(SPI_TX_DMA_isr_cfg.intrSrc);
SPI_TX_DMA_SetXloopDataCount(&SPI_TX_DMA_Descriptor, len);
SPI_TX_DMA_SetXloopSrcIncrement(&SPI_TX_DMA_Descriptor, 1);
SPI_TX_DMA_Start((const void *) buf, (const void *) SPI_HW->TX_FIFO_WR);
return 0;
}
int8_t SpiDma_Read(uint8_t *buf, uint16_t len) {
if (len == 0) {
return -1;
}
NVIC_EnableIRQ(SPI_RX_DMA_isr_cfg.intrSrc);
SPI_TX_DMA_SetXloopDataCount(&SPI_TX_DMA_Descriptor, len);
SPI_RX_DMA_SetXloopDataCount(&SPI_RX_DMA_Descriptor, len);
SPI_TX_DMA_SetXloopSrcIncrement(&SPI_TX_DMA_Descriptor, 0);
SPI_RX_DMA_Start((const void *) SPI_HW->RX_FIFO_RD, (const void *) buf);
SPI_TX_DMA_Start((const void *) &_spiReadToken, (const void *) SPI_HW->TX_FIFO_WR);
return 0;
}
Conceptually, this makes sense to me. I change the X loop length, then start the transaction. For the read, I remove the increment of the tx, as I'm just sending a dummy variable. However, in Cy_DMA_Descriptor_SetXloopSrcIncrement(), I fail the assert:
CY_ASSERT_L1(CY_DMA_SINGLE_TRANSFER != Cy_DMA_Descriptor_GetDescriptorType(descriptor));
I have tried using the Y loop to trigger "len" X loops of 1, but then I fail another assert.
Also, it seems that the max transfer length is of 256 elements. How can I deal with transfers of 512 bytes?
Thank you,
Fred
Show LessHi,
I need to start the SPI at 400 kHz, and then to 24 MHz. However, I can only go to 12MHz.
Clk_Peri = 96 MHz
Clk_Slow = 48 MHz
SPI_oversample = 4
Clock_SPI_divider = 60 // 400 kHz
In my code, I do some transactions at 400kHz, then I change the Clock_SPI_divider to 1, which should give me 24 MHz. However, I only measure 12MHz.
Is there a limitation that any peripheral can only go to Clk_Peri / 2? If so, is the advertised 25MHz only available when oversampling = 2, which is only available when MISO is not used?
Thanks,
Fred
Show LessHello,
i’ve bought some CY8CPROTO-062-4343W-dev boards.
At first I’ve tried to program them with the ModuleToolBox under Linux. This works fine for me.
But there I do not see the possibility to access both kernels. So I’ve tried the Psorc creator. When I am trying to programm the target the application gets very lagy. SO I tried the programmer manually.
The Kit-Programmer 3 says that the programming fails with:
Program Finished at 16:37:37 |
| Programming Terminated
| Detected JTAG ID: "6B A0 24 77" is not in database
Program Requested at 16:36:52 |
Successfully Connected to KitProg3 (CMSIS-DAP/BULK/041A048B02237400) at 16:36:48 | KitProg3. CMSIS-DAP Version 2.0.0. Firmware Version 1.01.158. Hardware Id 11.
Opening Port at 16:36:48 |
I’ve already have updated the applications by using the psocCreator 4.2 (4.2.0.641)
About Kit-Programmer:
Installed CyInstaller Products:
Bridge Control Panel 1.20.0.4358
Clock Programmer 1.9.0.4358
Device Database 4358
Example Code 4358
PSoC Programmer 3.28.5.4358
USB Bootloader Application 4358
Thanks for helping
Sebastian
Show LessForgive my gibberish with google translation
I use CY8C62xA IC,But I did not find the relevant demo,
I need a sdk2.0 dfu demo,The transmission mode is serial port.
Thanks
Show LessBoth of these kits are dead. They will not take a new program and will not run the last program programmed into them.
The Programmer (3.28.5.4358) appears to connect with the device (KitProg).
I am using Creator 4.2.
Leds 2 and 4 are on solid.
Creator can not program the unit and appears to only see the KitProg.
I did program several programs into both devices with no problem and all seemed to work well.
I do not remember using any power other then the USB cable.
Since both devices are doing the same thing I guess I have done something but I don't know what at this point. I have been using PSoC Creator on other devices for years with no problem.
Since I am on Social Security there is no hope of getting either one of these devices again. But it would have been nice to know what I did.
I was going to just trash the devices but Sampath Selvaraj (Applications Engineer Senior Staff) said to post it to see if anybody had an idea as to what happened.
So, here it is...…….
Thanks for any comment
Lost In My Own World
Show LessHi,
I'm trying to do LE Secure connection with PSOC6 and pairing is currently failing at the DHKey check. Cysmart reports:
[13:47:00:636] : 'Initiate Pairing' request sent
[13:47:00:636] : 'Command Status' event received
[13:47:00:636] : Status: BLE_STATUS_OK
[13:47:00:651] : 'Negotiated pairing parameters' event received
[13:47:00:651] : State: Pairing negotiated
[13:47:00:651] : Security Level: 0x03
[13:47:00:651] : Encryption Key Size: 16
[13:47:00:651] : Bonding: 0x01
[13:47:00:651] : Pairing properties: NONE
[13:47:01:931] : 'Authentication Error Notification' event received
[13:47:01:931] : Status: AUTH_ERROR_DHKEY_CHECK_FAILED
Error: gpm.M1118: Authentication failed. DHKey check value received from peer device does not match with the calculated value
On the device, I get:
CY_BLE_EVT_GAP_DEVICE_CONNECTED: 0, 7(8.75 ms), 0, a
CYBLE_EVT_AUTH_REQ: security=0x3, bonding=0x1, ekeySize=0x10, err=0x0
CY_BLE_EVT_GAP_SMP_NEGOTIATED_AUTH_INFO: security=0x3, bonding=0x1, ekeySize=0x10, err=0x0
CYBLE_EVT_GAP_AUTH_FAILED: 0x24
However, 0x24 doesn't look like a valid value of cy_en_ble_gap_auth_failed_reason_t. Where can I find out what this error code means and how to fix it?
Thanks,
Theo
Show LessI studied CE220924 to create a PSoC 6 MCU VDAC sine wave generator using DMA. There is reference to an ECN 5947247 new code example at the end of the document. However, I'm unable to find that document or any code example in searches. Can anyone help?
Show LessHi, I have a new PSOC6 BLE Pioneer Kit Rev G and it's working great with Modustoolbox 2.0 on MacOs. However, many examples that were done for Creator are not available (or I can't find them) for ModusToolbox. Can anybody help?
I don't want to use Creator, I have everything on MacOS.
In particular, I'm looking for these examples for Modustoolbox:
1.CE218137_BLE_Proximity_RTOS
2. CE220331_BLE_UI_RTOS
3. CE218138_BLE_Thermometer_RTOS
i'm new to Cypress and PSOC so I hope you can direct me to the right place.
Thank you
Show Less