PSoC™ 5, 3 & 1 Forum Discussions
text.format{('custom.tabs.no.results')}
Hi guys,
There is a board which we have produced more than 5000pcs.
But these days we find 6 boards show that the PSOC USB communication is abnormal. The PSOC communicates with the other CPU by USB.
I used the USB analyzer to capture the communication packet:
- INVALID status packet shows "The handshake is missing. "
- ERROR status packet shows wrong CRC.
Can anyone tell me the probable cause?
Thanks.
Best regards.
Zl
Show LessAre there macros anywhere in the standard generated code (or, in a code sample, if need be) for setting / clearing / toggling bits through the Cortex M3 bit-banding feature?
I'd like to take advantage of this for uninterruptible read/modify/write of some status bits associated with each of a bunch of buffers in the SRAM. From what I understand it should be possible, but I'm wondering if I need to roll my own. I'm OK with assembly, not so much with the C preprocessor.
Show LessHi All,
I'm looking to integrate the safety software libraries from AN78175 into a PSoC5LP project I'm working on that requires some more intensive self-testing of RAM/Flash/CPU. My issue is in trying to assemble the SelfTest_CPU_s.s assembly source file. For some reason it doesn't seem to recognize the semicolon character as denoting a comment?
Here are the complete contents of the file:
;-------------------------------------------------------------------------------
; FILENAME: SelfTest_CPU.s
; Version 1.0
;
; DESCRIPTION:
; Assembly routines for RealView compiler.
;
;-------------------------------------------------------------------------------
; Copyright 2010-2012, Cypress Semiconductor Corporation. All rights reserved.
; You may use this file only in accordance with the license, terms, conditions,
; disclaimers, and limitations in the end user license agreement accompanying
; the software package with which this file was provided.
;-------------------------------------------------------------------------------
AREA |.text|,CODE
THUMB
;-------------------------------------------------------------------------------
; Function Name: CPU_PSoC_5_Asm
;-------------------------------------------------------------------------------
; Summary:
; Tests all ARM M3 CPU registers except PC.
;
; Parameters:
; None
;
; Return:
; void.
;
;-------------------------------------------------------------------------------
; void CPU_PSoC_5_Asm(void)
CPU_PSoC_5_Asm FUNCTION
EXPORT CPU_PSoC_5_Asm
PUSH {R1-R12, LR}
MOV R0, #0xAAAAAAAA
CMP R0, #0xAAAAAAAA
BNE.W test_asm_fail
MOV R0, #0x55555555
CMP R0, #0x55555555
BNE.W test_asm_fail
MOV R1, #0xAAAAAAAA
CMP R1, #0xAAAAAAAA
BNE.W test_asm_fail
MOV R1, #0x55555555
CMP R1, #0x55555555
BNE.W test_asm_fail
MOV R2, #0xAAAAAAAA
CMP R2, #0xAAAAAAAA
BNE.W test_asm_fail
MOV R2, #0x55555555
CMP R2, #0x55555555
BNE.W test_asm_fail
MOV R3, #0xAAAAAAAA
CMP R3, #0xAAAAAAAA
BNE test_asm_fail
MOV R3, #0x55555555
CMP R3, #0x55555555
BNE test_asm_fail
MOV R4, #0xAAAAAAAA
CMP R4, #0xAAAAAAAA
BNE test_asm_fail
MOV R4, #0x55555555
CMP R4, #0x55555555
BNE test_asm_fail
MOV R5, #0xAAAAAAAA
CMP R5, #0xAAAAAAAA
BNE test_asm_fail
MOV R5, #0x55555555
CMP R5, #0x55555555
BNE test_asm_fail
MOV R6, #0xAAAAAAAA
CMP R6, #0xAAAAAAAA
BNE test_asm_fail
MOV R6, #0x55555555
CMP R6, #0x55555555
BNE test_asm_fail
MOV R7, #0xAAAAAAAA
CMP R7, #0xAAAAAAAA
BNE test_asm_fail
MOV R7, #0x55555555
CMP R7, #0x55555555
BNE test_asm_fail
MOV R8, #0xAAAAAAAA
CMP R8, #0xAAAAAAAA
BNE test_asm_fail
MOV R8, #0x55555555
CMP R8, #0x55555555
BNE test_asm_fail
MOV R9, #0xAAAAAAAA
CMP R9, #0xAAAAAAAA
BNE test_asm_fail
MOV R9, #0x55555555
CMP R9, #0x55555555
BNE test_asm_fail
MOV R10, #0xAAAAAAAA
CMP R10, #0xAAAAAAAA
BNE test_asm_fail
MOV R10, #0x55555555
CMP R10, #0x55555555
BNE test_asm_fail
MOV R11, #0xAAAAAAAA
CMP R11, #0xAAAAAAAA
BNE test_asm_fail
MOV R11, #0x55555555
CMP R11, #0x55555555
BNE test_asm_fail
MOV R12, #0xAAAAAAAA
CMP R12, #0xAAAAAAAA
BNE test_asm_fail
MOV R12, #0x55555555
CMP R12, #0x55555555
BNE test_asm_fail
MOV LR, #0xAAAAAAAA
CMP LR, #0xAAAAAAAA
BNE test_asm_fail
MOV LR, #0x55555555
CMP LR, #0x55555555
BNE test_asm_fail
; Test SP register
; Note: SP ignores writes to the lower two bits,
; so they are intentionally set to 0
; Save SP to R0
MOV R0, SP
; Load SP with 0xAAAAAAA8
LDR R1, =0xAAAAAAA8
MOV SP, R1
CMP SP, R1
; Restore SP and return failure
IT NE
MOVNE SP, R0
BNE test_asm_fail
; Load SP with #0x55555554
LDR R1, =0x55555554
MOV SP, R1
CMP SP, R1
IT NE
MOVNE SP, R0
BNE test_asm_fail
MOV SP, R0
; Return success
MOV R0, #0
POP {R1-R12, LR}
BX LR
; Return failure
test_asm_fail
MOV R0, #0x00000001
POP {R1-R12, LR}
BX LR
ENDFUNC
END
;[] END OF FILE
I do know this code is quite old (from what looks like 2012). Is there some incompatibility? I notice it calls out the "RealView Compiler" in the top comment block. Is this perhaps some legacy compiler/assembler that is no longer used?. In any case, does ARM GNU GCC not see semicolons as comments? Should I just remove this source file and use the CPU_PSoC_Asm() function that's written in the SelfTest_CPU_asm.c file instead? I believe it is doing essentially the same thing:
__attribute__((naked)) uint8 CPU_PSoC_Asm(void) /* declaration of function if PSoC 5 GCC compiler */
{
/* Disable global interrupts */
CyGlobalIntDisable;
__ASM volatile (
" PUSH {R1-R12, LR} \n\t"
CPU_REGISTER_TEST("R0")
#if (ERROR_IN_CPU_REGISTERS)
CPU_REGISTER_TEST_ERROR("R1")
#else
CPU_REGISTER_TEST("R1")
#endif
CPU_REGISTER_TEST("R2")
CPU_REGISTER_TEST("R3")
CPU_REGISTER_TEST("R4")
CPU_REGISTER_TEST("R5")
CPU_REGISTER_TEST("R6")
CPU_REGISTER_TEST("R7")
CPU_REGISTER_TEST("R8")
CPU_REGISTER_TEST("R9")
CPU_REGISTER_TEST("R10")
CPU_REGISTER_TEST("R11")
CPU_REGISTER_TEST("R12")
CPU_REGISTER_TEST("LR")
/* Test SP register */
/* Note: SP ignores writes to the lower two bits,
so they are intentionally set to 0 */
/* Save SP to R0 */
" MOV R0, SP \n\t"
/* Load SP with 0xAAAAAAA8 */
" LDR R1, =0xAAAAAAA8 \n\t"
" MOV SP, R1 \n\t"
" CMP SP, R1 \n\t"
/* Restore SP and return failure */
" IT NE \n\t"
" MOVNE SP, R0 \n\t"
" BNE __test_asm_fail \n\t"
/* Load SP with 0x55555554 */
" LDR R1, =0x55555554 \n\t"
" MOV SP, R1 \n\t"
" CMP SP, R1 \n\t"
" IT NE \n\t"
" MOVNE SP, R0 \n\t"
" BNE __test_asm_fail \n\t"
" MOV SP, R0 \n\t"
/* Return success */
" MOV R0, #0 \n\t"
" POP {R1-R12, LR} \n\t"
" BX LR \n\t"
/* Return failure */
"__test_asm_fail: \n\t"
" MOV R0, 0x00000001 \n\t"
" POP {R1-R12, LR} \n\t"
" BX LR \n\t");
/* Enable global interrupts */
CyGlobalIntEnable;
/* end of assembler code for PSoC 5 */
}
I'll note that this also throws an error on CyGlobalIntDisable/CyGlobalIntEnable: "non-ASM statement in naked function is not supported". Can probably just replace those with " CPSID i \n\t" and " CPSIE i \n\t" respectively?
I'm using PSoC Creator 4.3 and the compiler is ARM GCC 5.4-2016-q2-update.
Thanks in advance the for the help!
Show LessCan i get the list of devices that support Airplay 2 protocol ?
Also can you explain the procedure to get the SDK for Apple Airplay 2.
Thank you
Show LessIn the application, the EzI2Cs module function is applied, when the host stops the I2C communication, the slave PSoC needs to suspend the I2C function and use the original SCL port as a port that outputs high and low levels, the software does not contain the IO port user module, how can I add it? Or how to set the registers to realize the function?
smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/PSoC-5-3-1/%E6%96%B0%E4%BA%BA%E6%8F%90%E9%97%AE-PSoC1-%E5%A6%82%E4%BD%95%E5%9C%A8PSoC-designer-5-4%E4%B8%AD%E5%8A%A0%E5%85%A5IO%E5%8F%A3%E7%94%A8%E6%88%B7%E6%A8%A1%E5%9D%97/td-p/490614
Show LessHello,
I am attempting to communicate to my CY8CKIT-030A on my Windows machines via the USB/UART bridge.
On 2/27/24, Windows was able to detect my board as a COM port and I could communicate to the device with no issue.
Returning to my project a couple weeks later and now the board does not come up in the list of available COM ports in Device Manager. Additionally, I tried it on my co-workers system, and that system encountered the same issue.
I installed the latest version of PSoC Creator on a brand new Lenovo ThinkStation and encountered the same issue.
I can see the DVKProg(3.4.1.20) listed in the USB controllers.
Any help getting this board operational again would be greatly appreciated.
Show LessThe following MIDI project is a simpler version of the 'MIDI Piano' project. What I need at the moment is blinking an LED when the host sends any MIDI Sysex message. However, when I plug the board into the host PC, I get the following error message:
When I comment out the MIDI identity reply part (as in the MIDI Piano project), I don't have this problem however the host PC does not recognise the MIDI device. What am I missing?
#include "project.h"
#include <stdlib.h>
#include <stdio.h>
#include <USBMIDI1_midi.h>
#define BlinkLED(); {Pin_LED_Write(1); CyDelayUs(3); Pin_LED_Write(0);} // blink LED indicator
//===========================================
// Global variables
//===========================================
char buff[32];//output UART buffer
#define DEVICE (0u)
#define MIDI_MSG_SIZE (4u)
// Identity Reply message
const uint8 CYCODE MIDI_IDENTITY_REPLY[] = {
0xF0u, // SysEx
0x7Eu, // Non-real time
0x7Fu, // ID of target device (7F - "All Call")
0x06u, // Sub-ID#1 - General Information
0x02u, // Sub-ID#2 - Identity Reply
0x7Du, // Manufacturer's ID: 7D - Educational Use
0xB4u, 0x04u, // Family code
0x32u, 0xD2u, // Model number
0x01u, 0x00u, 0x00u, 0x00u, // Version number
//0xF7 //End of SysEx automatically appended
};
//extern volatile uint8 USB_MIDI1_InqFlags; // Need for Identity Reply message
void Init()
{
CyGlobalIntEnable;
// USBMIDI_1_Start(DEVICE, USB_DWR_VDDD_OPERATION); // Start USBFS device 0 with VDDD operation
USBMIDI1_Start(DEVICE, USBMIDI1_DWR_POWER_OPERATION);
CyDelay(20);
}
//==============================================================================
// Function Name: main
//==============================================================================
// Summary:
// 1. Starts the USBFS device and waits for enumaration.
//==============================================================================
int main()
{
Init();
while(1u) // forever
{
/* Host can send double SET_INTERFACE request */
if(0u != USBMIDI1_IsConfigurationChanged())
{
if(0u != USBMIDI1_GetConfiguration()) // Initialize IN endpoints when device configured
{
USBMIDI1_Init(); // Enable output endpoint
}
}
// Service USB MIDI when device is configured
if(0u != USBMIDI1_GetConfiguration())
{
// Call this API from UART RX ISR for Auto DMA mode
#if(!USB_EP_MANAGEMENT_DMA_AUTO)
USBMIDI1_MIDI_IN_Service();
#endif
// In Manual EP Memory Management mode OUT_EP_Service()
// may have to be called from main foreground or from OUT EP ISR
#if(!USBMIDI1_EP_MANAGEMENT_DMA_AUTO)
USBMIDI1_MIDI_OUT_Service();
#endif
// Sending Identity Reply Universal System Exclusive message back to computer
if(0u != (USBMIDI1_MIDI1_InqFlags & USBMIDI1_INQ_IDENTITY_REQ_FLAG))
{
USBMIDI1_PutUsbMidiIn(sizeof(MIDI_IDENTITY_REPLY), (uint8 *)MIDI_IDENTITY_REPLY, USBMIDI1_MIDI_CABLE_00);
USBMIDI1_MIDI1_InqFlags &= ~USBMIDI1_INQ_IDENTITY_REQ_FLAG;
}
}
}
}
//void USBMIDI1_callbackLocalMidiEvent(uint8 cable, uint8 *midiMsg) CYREENTRANT
//{
// BlinkLED();
// cable = cable; // to avoid a warning message (var not used..)
// *midiMsg = *midiMsg;
//}
//==============================================================================
// Function Name: USB_MIDI1_ProcessUsbOut_EntryCallback
//==============================================================================
// Summary: Turn the LED_OutA on at the beginning of the function
// USB_MIDI1_ProcessUsbOut() when data comes to be put in the UART1 out
// buffer.
//
// To enable interrupts set USB_(MIDI descriptor)_(External Mode) = True
//==============================================================================
//void USB_MIDI1_ProcessUsbOut_EntryCallback(void)
//{
// BlinkLED();
//
//}
//==============================================================================
// Function Name: USB_MIDI1_ProcessUsbOut_ExitCallback
//==============================================================================
// Summary: Turn the LED_OutA off at the end of the function
// USB_MIDI1_ProcessUsbOut() when data is put in the UART1 out-buffer.
//
// To enable interrupts set USB_(MIDI descriptor)_(External Mode) = True
//==============================================================================
/*
void USB_MIDI1_ProcessUsbOut_ExitCallback(void)
{
//LED_OutA_Write(0);
}
*/
/* [] END OF FILE */
Any help would be appreciated.
Show Less
Hello everyone! Can you tell me if the PSoC MiniProg works as an ICE emulator on PSoC Designer 5.4?
smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/PSoC-5-3-1/PSoC-MiniProg%E5%9C%A8PSoC-Designer5-4%E4%B8%8A%E5%8F%AF%E4%BD%9C%E4%B8%BAICE%E4%BB%BF%E7%9C%9F%E5%99%A8%E4%BD%BF%E7%94%A8%E5%90%97/td-p/469534
Show LessI'm trying to understand the USB setup. I have a board that has a USB connector connected to the DP and DM pins on the PSOC5. I copied the code from the USBFS example and it runs, but hangs when trying to check the configuration. That appears to be because the Windows 10 computer does not recognize the USB device. It shows up in device manager under "Universal Serial Bus controllers", as "Unknown USB device (Device Descriptor Request Failed)". I am not sure if this is a hardware or software issue. The various documents seem to indicate that I have to find and install a special Windows device driver for the USBFS. I followed the instructions to install it but when I selected the .inf file, I got a message that a compatible file was not found. (That was when trying to install the driver from the unknown USB device entry in device manager.)
In general, why should I need a special device driver? I want to produce a product that creates a com port for anyone who installs it into windows. Why won't the Ftdi drivers work? Is there any path to making them work?
But, from reading, I am not at all sure that this is a driver problem.
Help please.
Thanks Russ
Show LessHi,
I set up a CAN component with multiple mailboxes. How can set only certain mailboxes to acknowledge messages while other mailboxes shouldn’t. I would need this functionality because I place a PSOC in a CAN network, where it should only listen to the ongoing traffic. At a certain moment I bring another device in to talk to the PSOC. Here I need it to acknowledge messages.
How do set this up? Is it possible to select which mailboxes should acknowledge and which not?
I really hope so, as I don’t really like to config two CAN components to do so.
Best, rose
Show Less