I modified the example from "...\Freescale USB Stack v4.0.3\Source\Host\examples\cdc_serial\cw10\kinetis_l2k" to use it with openSDA on FRDM-KL25Z.
I can send data from Host to CDC device but not from Device to HOST. It doesn't works. Host doesn't receive nothing.
Function _io_cdc_serial_read always return 0.
If I connect the device to a PC, I can see in the hyperterminal the data sent, so the problem seems to be on the host.
I need change any specific register initialization code?
This example works correctly in TWRMKL25z ?
Solved! Go to Solution.
In the usb_class_cdc_set_acm_ctrl_state() function, at lines 350 / 351 if_acm_ptr->ctrl_state.bmStates[1] should be changed with if_acm_ptr->ctrl_state.bmStates[0]. The problem was that the state was sent on the usb in big endian instead of little endian.
In the usb_class_cdc_set_acm_ctrl_state() function, at lines 350 / 351 if_acm_ptr->ctrl_state.bmStates[1] should be changed with if_acm_ptr->ctrl_state.bmStates[0]. The problem was that the state was sent on the usb in big endian instead of little endian.