Hi Vicente.
I have checked this project and have found that in "startup_MK21FA12.s" file doesn't define information according to USBDCD interrupt.
I have added the next content:
PUBWEAK USBDCD_IRQHandler
PUBWEAK USB_DeviceDcdIsrFunction
SECTION .text:CODE:REORDER:NOROOT(2)
USBDCD_IRQHandler
LDR R0, =USB_DeviceDcdIsrFunction
BX R0
and have replaced at USBDCD_IRQHandler after this coded (below) to USB_DeviceDcdIsrFunction. After this correction the USBDCD interrupt begins to work, but with not full detection. It can detect that connected the real charger - it goes to section "Depricated_charger". But in other cases, when USB is connected or not connected to PC I can't view differences: program goes to the same section: "SDP_Detected". I have transferred USBDCD code configuration to my project to files USBCDC.c and USBCDC.h and get the same detection.
For me is very important to detect are my system is connected to PC USB or not connected. After detection I want to decide: do reset from the Main application and go to Bootloader or stay work with the Main application.
The Main application doesn't have driver communication to PC, the Main application is the Baredoard project. Therefore I have created my own USBDCD file and not use with the NXP driver.
I have checked my USBDCD code and don't found any differences vs original weight project USBDCD configuration. My code is very simple but doesn't work. I am working with the Tower board. May be needed to configure any jumpers on the Tower board (I have already checked Tower documentation)? For debugger, I am using a J2 connector and fo USBDCD detection I am using with J19 connector, like for USB CDC communication.
What is wrong?