Switching MCU type

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Switching MCU type

3,303 次查看
scottm
Senior Contributor II

I'm making another attempt to migrate a moderately complex existing project to the MCUX SDK and and I can't seem to get much beyond square one.

My understanding is that the only supported way to get the USB component of the SDK into a project is to import a demo project.  My target MCU is the MK22FN1M0AVLH12, but there's no board specifically for that MCU and the only supported board with any example projects in the SDK is the TWRK21F120M, which has an MK21FN1M0.  I'm starting with the dev_composite_cdc_msc_freertos demo.

I'm able to use the clocks tool to configure the project for the 12 MHz crystal my board uses, and with that set properly I'm at least able to boot and enumerate.  If I go into the pins tool, though, I see that the 64 LQFP package isn't available on this variant.  Changing to any variant gives me a warning that the processor type doesn't match, and I can't find where it expects that to be changed.  I get more errors if I go into the project settings and change the MCU type there.

Before I spend any more time chasing my tail, what is the proper way to do this?  My objective is to get a 'hello world' project set up for the MK22FN1M0AVLH12 with FreeRTOS, pins/clocks tools working properly, and SDK drivers for basically everything except flexbus, flexcan, crc, i2c, rnga, sdhc, and smartcard.

From there I plan to start bringing in the application code, resolving conflicts between the SDK and the existing drivers, and eventually rewriting the low-level code to use the SDK drivers wherever they're suitable.  I need to know I've got the project framework set up properly first, though.

If the pins and clocks tools aren't available for this MCU, is there documentation on how to migrate the project off of those tools?  The first thing I noticed is that clock_config.c has the oscillator frequency hard-coded in oscConfig_BOARD_BootClockRUN.freq, but it's also defined in the header as BOARD_XTAL0_CLK_HZ.  The fact that clock_config.c doesn't use the macro suggests that the tool-generated files were not intended to be edited by hand and it looks like I'd have to review the whole thing line by line to find that kind of duplication.

Thanks,

Scott

标签 (1)
11 回复数

2,540 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Scott,

MCUXpresso IDE has setting to change MCU, see

pastedImage_1.png


Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励

2,540 次查看
scottm
Senior Contributor II

Hi,

That doesn't seem to affect the pins tool, other than to make it display an error about a part mismatch:

pastedImage_1.png

pastedImage_2.png

pastedImage_3.png

As you can see, it's still only letting me choose from packages for the MK21FN.  How do I switch the configuration utilities to the right MCU?

Thanks,

Scott

0 项奖励

2,540 次查看
scottm
Senior Contributor II

Hi,

It's been a few weeks with no response so I'm bumping this again.  As a reminder, the issue is that I'm trying to create a project for the MK22FN1M0AVLH12 that has the SDK's USB stack.  I've been told that the only supported way to do this is to import an example project, but there are no example projects specific to that MCU and if I choose the tower development board for it, I can't find any way to switch the config tools to the new MCU.

How am I supposed to get there from here?

Thanks,

Scott

0 项奖励

2,540 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Scott,

User can choose device packages during creating a new project. see below:

pastedImage_1.png

But There is no user interface to change Device package for an existing project. My colleague has reported this issue. I will let you know if we get update.


Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励

2,540 次查看
scottm
Senior Contributor II

But how do you do that when there is no demo project for that MCU?  Or to use a more concrete example, can you show me how you would import a demo project for the MK22FN1M0AVLH12 that includes the USB stack?

Thanks,

Scott

0 项奖励

2,540 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Scott,

I got feedback from development team.

There is no way of changing MCU package for an existing project or for importing sdk demos under 10.2.1.

"this functionality will be available in the next release of the IDE 10.3.0 available in December."

Have a great day,
TIC

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励

2,541 次查看
scottm
Senior Contributor II

So what's the accepted procedure for getting the USB middleware into a project while retaining use of the config tools when there's not a demo project?  And where would I find that in the documentation?

Thanks,

Scott

0 项奖励

2,543 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Currently for MCUXpresso IDE 10.2.1, as this package changing feature is not added. User has to create a new project with the package you need, then manually add the code from samples.

Next moth when 10.3 releases, this will be easy.

BR,

Jennie Zhang

0 项奖励

2,543 次查看
scottm
Senior Contributor II

Is there some place this is documented?  Which MCUs are supported by which tools and middleware?  What do you consider the 'front door', where a customer should be visiting to keep an eye on this stuff?  The NXP site is kind of a labyrinth.

Pretend for a moment that you're a visitor who wants to know about the current USB stack and its capabilities for the MK22FN1M0AVLH12.  What path do you take from nxp.com?  If you go down to the K22_120 family, none of the USB related application notes are relevant to the current SDK.  If you search the documentation site for 'usb stack', you get a very old and obsolete bare metal stack as the first result, and no mention (at least in the first few pages) of MCUX.

The MCUXpresso SDK isn't listed under 'SDKs'.  MCUXpresso isn't listed under 'IDEs'.  The product brief doesn't mention MCUXpresso.  If you figure out that MCUXpresso SDK is what you want, the USB stack documentation is not apparent there, either.  'Additional links' takes you to an SDK page that has a documentation section, which contains no API documentation and only a brief mention in one document of the USB stack's existence.

As far as I can tell, you have to discover through experimentation that you have to build an SDK package for a specific device and include the USB stack, and *then* you get a download link for a ZIP file that contains the USB stack documentation.

Obviously I've figured this part out by now, but it makes me wonder how much other important information is out there that I just haven't found yet.  Can you walk me through what path NXP expects a customer to take when discovering this stuff?  And if that's not your department, could you perhaps forward this on to whoever *is* in charge of that?

Thanks,

Scott

2,543 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Scott,

You can check this table for the recommend SW IDE/SDK

MCUXpresso Supported Devices Table - through May 2018 

according to this table, k22F is recommended to use MCUXpresso IDE and SDK.

before download SDK, if you want to use USB, add USB component. download SDK. SDK package will include USB demos.

pastedImage_2.png

Best Regards

Jennie

0 项奖励

2,543 次查看
scottm
Senior Contributor II

Hi Jennie,

I appreciate the link, but my point is that this information is extremely hard to locate if you just start at nxp.com. To get this list you would already have to know that MCUXpresso is the tool to look at, and then come to the community support forum and find a spreadsheet in a post.

I'm also not convinced of the accuracy of that table.  I'm using the MK22FN1M0AVLH12.  According to the table, the recommended evaluation hardware is the FRDM-K22F or TWR-K22F120M.  The fact sheet also lists the TWR-K21F120MA as a development board for the family but doesn't indicate which part numbers it applies to.  Code for the FRDM-K22F or TWR-K22F120M does not in fact universally work on the MK22FN1M0AVLH12 because that part doesn't support HSRUN and doesn't have the 48 MHz oscillator.

If you check the comparison table, it says that the only hardware development tool for that part is the TWR-K21F120MA, which I believe to be correct.  The SDK builder selection tool also indicates the TWR-K21F120MA.

So in a few minutes of searching, I've found three different answers to the question "what development board should be used for the MK22FN1M0AVLH12" and two of them seem to be wrong.  Yes, the correct information exists, but it's like the saying that a man with two watches never knows what time it is.  There's nothing to indicate which place is correct.

Imagine for a moment that you're a user who has already selected a Kinetis part and wants to read the documentation for the current supported USB stack, starting from nxp.com.  Try to come up with some logical sequence of clicks or search terms that gets you to the appropriate information.  Is there some path there that I'm just not seeing?  What is the "front door" that NXP expects users to arrive by, if not the homepage?

Site UX is not your job, I understand.  But if someone would put some effort into organization, and maybe mark more obsolete or deprecated content as such, I'm sure it'd reduce the workload for customer support.  Not to mention making the customers a lot less frustrated.

Thanks,

Scott