Config tool to FLEXCOM UART setup LPCXpresso 55S69

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Config tool to FLEXCOM UART setup LPCXpresso 55S69

1,664 Views
a_guy
Contributor II

So , I created a FC2 UART configuration using the MCUXpresso Config tool , it created code, which is good.

I am working under the usart_interrupt_rb_transfer.c example for testing. I fire up the code and it gets to the BOARD_InitBootPeripherals(); and then I get an assert trap.

The problem is that an interrupt is being call for FC2 and there isn't a routine in there yet.

Some background, this example doesn't actually use the configuration tool for the example, it initialized the DEMO_USART in a manual way. This is fine and understandable. It configures the interrupt return routine in the USART_TransferCreateHandle() function.

My question is , when you use the Config tool, the code created does nothing with the interrupt service routine, so should I be setting this up BEFORE calling BOARD_InitBootPeripherals() ?? Why isn't there a ready made hook.

I guess I could turn off Enabled in initialization in Configuration screen. Then I can turn it on normally.
Its just not logical behavior , but then my expectations don't make something True...am I right?

Labels (1)
0 Kudos
Reply
4 Replies

1,644 Views
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Hello

 

The config tool will help you to initialize the module, for the usart interruption you need to add what the code will do in the interruption. The function BOARD_InitBootPeripherals() initializes the peripheral and enables the interruptions based in your configuration.

 

You can add the function USART_TransferCreateHandle() after calling the init function, in this way your code will execute code when an interruption is called.

 

Let me know if this is helpful, if you have more questions do not hesitate to ask me.

Best regards,

Omar

0 Kudos
Reply

1,639 Views
a_guy
Contributor II

The problem is that the BOARD_InitBootPeripherals() was enabling the interrupt. While debugging this was causing an assert because the interrupt was enabled before you could call the USART_TransferCreateHandle() function.

If the "solution" is to remove that from the generated code, then fine, but why enable interrupts if the callback routine isn't set yet. Its like there is a step missing in the code creation, like connecting a dummy callback should be done.

0 Kudos
Reply

1,655 Views
a_guy
Contributor II

I am starting to think that I can't use the MCU Config with the example program I am using.  I think there is an assumption that the MCU config will generate a blank template, and the example wants to use a larger library , with a few things taken care of ....

I think I should just use the example program setup and just undo the MCU Config Tool for now.
I would be nice if there was a UART walk through with the expected pieces needed after using the Config Tool.

0 Kudos
Reply

1,661 Views
a_guy
Contributor II

The assert occurs in the fsl_flexcomm.c source

#if defined(FLEXCOMM2)
void FLEXCOMM2_DriverIRQHandler(void)
{
    assert(s_flexcommIrqHandler[2]);
    s_flexcommIrqHandler[2]((uint32_t *)s_flexcommBaseAddrs[2], s_flexcommHandle[2]);
    SDK_ISR_EXIT_BARRIER;
}
#endif
0 Kudos
Reply