PSoC™ 4 Forum Discussions
I was using CY8CKIT-042-BLE very successfully. However, recently I have found this annoying error: There was an error running the Programmer to configure the device . Related to some earlier posts I have tried changing the cable, adjusted the speed of programming via Tools > Options > Program/Debug > Port Configuration.
I suspected corruption in the base board and attempted an upgrade of firmware with no improvement.
I have tried to get support from Cypress with a polite but not very helpful response.
Do I just abandon Cypress or buy a new kit? Sadly I was about to start telling my contacts what a wonderful thing the Cypress kit is.
Regards
Mike
Show LessI have implemented a high throughput L2CAP connection from the PSoC4 BLE to the CySmart 1.2 test dongle/program on Windows. I had assumed that Android and Linux would support recieving these type of connections, but have as yet to find anything that is even close. There is some RFCOMM support, but nothig that I can find allows me to recieve data from this PSoC using L2CAP? This would be a huge oversight to have a protocol with no destination support, so I assume I am missing something. Any advice?
Show LessAbout 6 months ago, someone posted a comprehensive explanation of an apparent vulnerability in PSoC 4 devices. The vulnerability would allow attackers to load malicious code to flash and then mark it as reserved for supervisor, allowing the code to survive chip erases and to run pretty much undetected. As he explains well, this potentially leads to all sorts of attack vectors, like replay attacks for touch screen devices.
Exploiting PSoC4 for fun and profit - Dmitry Grinberg
Reading the Unreadable SROM: Inside the PSoC4 | Hackaday
According to the author, Cypress has not responded to the problem. That was 6 months ago. Has anything been done by Cypress to mitigate or remove this vulnerability? It would seriously reduce the range of suitable applications for this chip, so it seems unlikely nothing was done.
Show LessHi,
I have a test project were i use the ADC SAR Seq available in the 4200M, i need to read three inputs, i decided to transfer the results of the conversions from the ADC to memory with DMA.
Each ADC channel have a specific register to save the conversion result, so as i have 3 inputs i needed three DMA channels to transfer the result of each input to memory, then trigger an interrupt on one DMA channel and do the conversion from counts to voltage, like so:
This is the main loop:
#include "project.h"
#include <stdio.h>
#include <stdbool.h>
volatile bool data_ready = false;
enum {
ADC_CHANNEL_0 = 0,
ADC_CHANNEL_1 = 1,
ADC_CHANNEL_2 = 2,
};
enum {
FORM_FEED_CMD = 0x0C,
};
struct adc_result {
char string[20];
float32 volts;
int16_t counts;
} adc_result;
CY_ISR_PROTO(DMA_Handler);
int main(void)
{
struct adc_result ADC_Data[ADC_SEQUENCED_CHANNELS_NUM];
size_t string_size = sizeof(ADC_Data[ADC_CHANNEL_0]) / sizeof(char);
DMA_Chn0_SetInterruptCallback(&DMA_Handler);
CyIntEnable(CYDMA_INTR_NUMBER);
CyGlobalIntEnable;
UART_Start();
UART_PutString("Test ADC -> DMA -> memory\r\n");
PWM_Start();
ADC_Start();
DMA_Chn0_Start((void*) ADC_SAR_CHAN0_RESULT_PTR, &ADC_Data[ADC_CHANNEL_0].counts);
DMA_Chn1_Start((void*) ADC_SAR_CHAN1_RESULT_PTR, &ADC_Data[ADC_CHANNEL_1].counts);
DMA_Chn2_Start((void*) ADC_SAR_CHAN2_RESULT_PTR, &ADC_Data[ADC_CHANNEL_2].counts);
ADC_StartConvert();
while (1) {
if ( true == data_ready ) {
UART_PutChar(FORM_FEED_CMD);
for (uint8_t channel = 0; channel < ADC_SEQUENCED_CHANNELS_NUM; channel++) {
ADC_Data[channel].volts = ADC_CountsTo_Volts(channel, ADC_Data[channel].counts);
snprintf(ADC_Data[channel].string, string_size, "CH %d: %.3f Volts\r\n", channel, ADC_Data[channel].volts);
UART_PutString(ADC_Data[channel].string);
}
data_ready = false;
}
}
}
CY_ISR(DMA_Handler)
{
data_ready = true;
CyDmaClearInterruptSource(DMA_Chn0_CHANNEL_MASK);
}
/* [] END OF FILE */
The test project seems to work but is it the most efficient way to implement it?
May be a waste of DMA channels but i will try to port this project to the 4L family and send the ADC conversion results to the PC via USB, so i need to keep the infinite loop of the main function almost empty for USB transactions i guess (haven't did a USB project before ).
Any advice or feedback?
The project is attached, i used Creator 4.1
Carlos
PD: The new forum seems great
Show LessHi everyone!
My code works and I have not observed a bug (yet), but I was wondering what the recommended / correct sequence is. In pseudo code, I do the following after waking up from any interrupt:
// Step 1. Woke up from a interrupt. Process BLE events:
CyBle_ProcessEvents();
// Step 2. Event close state?
if(CyBle_GetBleSsState() == CYBLE_BLESS_STATE_EVENT_CLOSE)
{
// Update manufacturer specific part of advertisement packet
ble_app_update_adv_packet();
}
// Step 3. Manage BLESS power modes
CyBle_EnterLPM(CYBLE_BLESS_DEEPSLEEP);
// Step 4. ****** Now perform all other tasks; this can take long, e.g. 40 ms ******
// Step 5. Go into low power sleep mode (redacted example)
interrupt_status = CyEnterCriticalSection();
if(CyBle_GetBleSsState() == CYBLE_BLESS_STATE_DEEPSLEEP)
{
CySysPmDeepSleep();
}
CyExitCriticalSection(interrupt_status);
Please observe step 4 where other tasks are performed and can introduce a long delay between step 3 and step 5.
Is this correct and the lowest power solution, or must I swap step 3 and step 4 so that CyBle_EnterLPM() is called just before CyEnterCriticalSection()? Why?
Thanks in advance,
Pieter
Show LessI tried to create a simple application with the CY8ckit-042 (the end product will use the CYBLE-214009-00 BLE Module)
I need to measure a few voltages (4x 250sps is enough) and write a single uint8 value from an app to the BLE device.
The BLE part with a custom profile and the measuring part are working perfectly on different devices, but when I tried to combine the functionalities I get a lot of write timeouts and malfunctions.
How can I use the ADC and other peripherals without interfering with the BLE part?
Show LessHi everyone,
I want to learn Host-Controller Interface (HCI) protocol.
- For testing and debugging, the Component can be configured to HCI mode through a Component embedded UART.
- The HCI layer implements a command, event, and data interface to allow link layer access from upper layers such as GAP, L2CAP, and SMP.
- HCI over UART In this mode the BLE host will communicate with the BLE controller via the UART.
My questions.
- What are the differences between software HCI - HCI over UART
- Is there a code sample outside this Day018_Direct_Test_Mode ?
- What can be done with software HCI - HCI over UART
- For example, can it be applied Server-Client communication?
After checking
Figure 20. CYBLE-022001-EVAL Board Pinout in Spec
and PRoC BLE in PSoC Creator 3.2
There is a bug in Spec and the board
In CYBLE-022001-EVAL Board Pinout,
the pin P1_3 should change to P4_0 with red color
and then publish a new board for it
becuase EZ-Module P4_0 need to connect to this pin.
I think it is a layout bug
HI all,
I am new on Cypress MCU and using CY8C4125LQI-S433 for development currently.
I have checked on 4100s datasheet in port pin assignments page. There are columns that call "Deep Sleep1 " and "Deep Sleep2".
What is it mean? It only work on deep sleep mode?
The problem is that I can 't use P2.4 for SPI functions in PSoC Creator.
There are no options for P2.4 as shown below.
Is it possible to use P2.4 for SPI functions?
Please help. Thanks.
Best regards,
Tom
Show Less