Hi Sabina,
Thank you for taking the time to reply.
I appreciate what you're trying to do and I must say that I'm impressed with what has been done with MCUXpresso IDE and the SDKs, but I'm really having trouble porting examle apps from the FRDM/TWRK SDKs (which are at the latest level) and the actual part SDKs (which are generally downlevel). If the example projects aren't easily ported to what should be virtually identical devices (same family although different revision level as you will see below).
I just spent the day trying to port the frdmk22f_dev_cdc_vcom_freertos and the frdm64k_dev_cdc_vcom_freertos (I did the second one because the K64 hardware seems to be closer to my target device, the MK22FN1M0AVLL12) but in both cases, while I got the ported projects to build without any warnings or errors but I ended uo with the following message when I tried to connect the board to a Windows 10 PC:

I should point out that the ...dev_cdc_vcom_freertos code works fine on the two Freedom boards (I have one of each, so I can test the code). The SDKs are 2.7.0 for the two Freedom boards, but the MK22 part that I am using has an SDK of 2.3.1 and many of the SDK "Components" (namely "Utilities", "Middleware", "Board Components" & "Software Components") that are available for SDK 2.7.0 are not available for the MK22 part SDK. The porting process that I'm going through is listed below. I should also point out that SDK 2.7.0 provides "Amazon FreeRTOS" while in SDK it is just "FreeRTOS" - I don't think this is an issue, but it could be.
I'm not really sure where to look for the problem and the two places I'm going to focus on initially are:
1) the "A" part which isn't in the two Freedom boards. Are there any hardware differences that I need to be aware of.
2) what are all the options for the builds. I thought I got the project "Properties" right, but maybe I'm missing something
3) the basic libraries provided for the parts in the SDK to see if there are any differences
4) ???
If you have any suggestions as to how to get the code working (the USB CDC device properly enumerating with the Windows 10 machine) I'd really appreciate them.
Thanx again for commenting,
myke
1. Create basic project. Create with:
- MK22FN1M0AVLL10
- FreeRTOS
Drivers:
- clock
- common
- uart
Utilities:
- assert
- debug_console
2. Setup clocks and USB IO Pins.
- Just USB IO Pins
- Setup 8MHz clock (like the FRDM_K22F board)
- Run as a PEE device
- Set the PLL to " / 2 * 30 " to get 120MHz
3. Build and test.
4. Create "source folders" for:
- components
- usb
5. Copy from the srouce project the contents of the "components" and "usb" folders
6. Attempt to build project
Files to copy in:
- "source/usb_device_config.h"
Folders to add to Properties "includes":
- "usb/include"
- "usb/device/include"
- "usb/device/class/cdc"
- "usb/device/source"
- "usb/device/source/khci"
- "component/lists"
- "component/osa"
- "component/uart"
Options to add to Properties "PreProcessor":
- FSL_OSA_BM_TASK_ENABLE=0
- FSL_OSA_BM_TIMER_CONFIG=0
- SERIAL_PORT_TYPE_UART=1
Copy from source project "drivers/fsl_common.h" and, aftger "kStatusGroup_ApplicatinoRangeStart", add:
kStatusGroup_IAP = 102, /*!< Group number for IAP status codes */
kStatusGroup_HAL_GPIO = 121, /*!< Group number for HAL GPIO status codes. */
kStatusGroup_HAL_UART = 122, /*!< Group number for HAL UART status codes. */
kStatusGroup_HAL_TIMER = 123, /*!< Group number for HAL TIMER status codes. */
kStatusGroup_HAL_SPI = 124, /*!< Group number for HAL SPI status codes. */
kStatusGroup_HAL_I2C = 125, /*!< Group number for HAL I2C status codes. */
kStatusGroup_HAL_FLASH = 126, /*!< Group number for HAL FLASH status codes. */
kStatusGroup_HAL_PWM = 127, /*!< Group number for HAL PWM status codes. */
kStatusGroup_HAL_RNG = 128, /*!< Group number for HAL RNG status codes. */
kStatusGroup_TIMERMANAGER = 135, /*!< Group number for TiMER MANAGER status codes. */
kStatusGroup_SERIALMANAGER = 136, /*!< Group number for SERIAL MANAGER status codes. */
kStatusGroup_LED = 137, /*!< Group number for LED status codes. */
kStatusGroup_BUTTON = 138, /*!< Group number for BUTTON status codes. */
kStatusGroup_EXTERN_EEPROM = 139, /*!< Group number for EXTERN EEPROM status codes. */
kStatusGroup_SHELL = 140, /*!< Group number for SHELL status codes. */
kStatusGroup_MEM_MANAGER = 141, /*!< Group number for MEM MANAGER status codes. */
kStatusGroup_LIST = 142, /*!< Group number for List status codes. */
kStatusGroup_OSA = 143, /*!< Group number for OSA status codes. */
kStatusGroup_COMMON_TASK = 144, /*!< Group number for Common task status codes. */
kStatusGroup_MSG = 145, /*!< Group number for messaging status codes. */
kStatusGroup_SDK_OCOTP = 146, /*!< Group number for OCOTP status codes. */
kStatusGroup_SDK_FLEXSPINOR = 147, /*!< Group number for FLEXSPINOR status codes.*/
kStatusGroup_CODEC = 148, /*!< Group number for codec status codes. */
kStatusGroup_ASRC = 149, /*!< Group number for codec status ASRC. */
kStatusGroup_OTFAD = 150, /*!< Group number for codec status codes. */
7. Build and Test
8. "#ifdef" out the "main" method in the project .c file
8. Copy from source project
- "source/usb_device_descriptor.c"
- "source/usb_device_descriptor.h"
- "source/virtual_com.c"
- "source/virtual_com.h"
- "drivers/fsl_sysmpu.c"
- "drivers/fsl_sysmpu.h"
9. In the "main" method of "virtual_com.c" comment out:
- BOARD_InitPins();
- BOARD_BootClockRUN();
And replace from the project's "main" method with:
- BOARD_InitBootPins();
- BOARD_InitBootClocks();
- BOARD_InitBootPeripherals();
10. Build and Test