-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for the NXP K64 series #2168
Conversation
- teensy_35 is not able to blink led with board_test though, probably due to clock config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you very much for your PR. I have rename the option from OPT_MCU_KINETIS_K64
to simply OPT_MCU_KINETIS_K
since it seems to be the name of family of those m4f.
I have tried to add kinetis_k to bsp with teensy_35 board to test with this PR. Unfortunately teensy 3.5 is not able to blink led with board_test example. It is probably due to clock config. I push the changes anyway, will try to find an k64f board later to test with. Menanwhile please be patient.
Update: I haved ordered frdm-k64f board for testing out this PR, it may take 3-4 weeks before it got delivered. Please be patient, thanks.
I've got another tree with frdmk-64 support as well. I'll compare the two and comment. |
Why did you need the freertosconfig.h file? That seems unnecessary to have another copy of it? (and freertos demos work fine for me without it) I'm still clearing our work with internal management, so it's not (very) publically shared yet unfortunately. |
It is part of my new approach, previously there is 1 freertos (per example) for all ports. However, that makes it difficult to compile with IAR since freeRTOSConfig.h is included by IAR assembler which is very primitive and cannot support complicated include like gcc assembler. SO I have moved freeRTOSconfig.h to each bsp, it kind of make sense as well, since each hardware would have different freertosconfig. Currently only cmake make use of the new config (make still use the example's one), but eventually, when all bsp has its own config, I will remove the example's config later. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you, I have tested this with my frdm k64f board, working well. The save/restore crystal-less configuration is required, otherwise setting will be reset. There is no harm to restore these value when not using crystal-less mode
well, my only other concern is that not all the kinetis parts have those crystalless config registers, so we're going to be writing into registers that don't always exist. |
I will pull out to test with my kl25z board, I think it shouldn't have any effect. In my experience, these registers exist anyway, it is just readonly. If it is an issue, We can actually check the IRC_EN bit before restoring value, but I guess it is not really needed. |
PS: it cause out-of-memory issue on KL25Z, PR is on the way to fix this :) #2489 |
I'm back from holidays, and this asserts ( My local version (didn't get to a PR) works fine. I can't see what the difference would be (yet) but I'm obviously goin to have to find out :) Did this example work for you at all? Related to the FreeRTOSConfig files, the newly added file is not even used at present. At least in the host/cdc_msc_hid_freertos. I added #error calls, and it's still using the standard one from the example. (however, the diff is minimal, and it shouldn't be changing stack sizes as far as I can tell) |
|
pin muxing is done by boards/pin_mux.c which I use mcupinconfig to generate.
yeah, I think I only tested with the cmake version, I will test with make later and adjust the heapsize when testing with the board again. Planning to do full migration but couldn't manage the time. |
Here I am working with a FRDM-K64F board and try to get the TinyUSB up and running.
It takes some time, but I could found the problem why it is not working at first.
In case of the K64 the USB clock will be set with e.g.
CLOCK_EnableUsbfs0Clock(kCLOCK_UsbSrcIrc48M, 48000000U);
This function will set inside some registers which are needed for the USB clock recovery:
Unfortunately this registers will be reset by the dcd_init function where a USB reset is performed.
This PR fix the problem in case of a K64 series. With this changes the device will be enumerated.
I am still in the progress of testing.
Best regards,
Michael