LPC 54616 config tools

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

LPC 54616 config tools

953 Views
ali3
Contributor II

Hi . My company start a project with your lpc54616 mcu. İm try mcuxpresso config tools. İn peripheral drivers dont work. This funktion generates code like this;.

const mcan_config_t CAN0_config = {
,
,
,
.enableCanfdNormal = false,
.enableCanfdSwitch = false,
,
,
,
,
,

};

const i2c_master_config_t FLEXCOMM0_config = {
.enableMaster = true,
,
.enableTimeout = false
};

why its not working?

Labels (1)
0 Kudos
5 Replies

804 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Ali,

The "Pripherals configuration function in ConfigTools" integrated in MCUXpresso IDE tools can only initialize the CAN module, it does not provide any api function for the CAN communication.

I suggest you download the SDK package from the link:

MCUXpresso SDK | Software Development for Kinetis, LPC, and i.MX MCUs | NXP 

There is CAN communication example in the SDK package based on LPC546xx.

Hope it can help you

BR

XiangJun Rong

0 Kudos

804 Views
ali3
Contributor II

I understand. But this ConfigTools can't start this module or i2c module.  I start new project with sdk and select requiered driver in confugure window then craeted my new roject. İf i compile in this time its fine .after im start configtools for prephirial its dont work correctly. you see in below automaten code.

/***********************************************************************************************************************
* This file was generated by the MCUXpresso Config Tools. Any manual edits made to this file
* will be overwritten if the respective MCUXpresso Config Tools is used to update this file.
**********************************************************************************************************************/

/* clang-format off */
/* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
!!GlobalInfo
product: Peripherals v7.0
processor: LPC54618J512
package_id: LPC54618J512ET180
mcu_data: ksdk2_0
processor_version: 7.0.1
functionalGroups:
- name: BOARD_InitPeripherals
UUID: 1a6bae12-3fc1-4eb3-98e6-8904d53e40c5
called_from_default_init: true
selectedCore: core0
* BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/

/* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
component:
- type: 'system'
- type_id: 'system_54b53072540eeeb8f8e9343e71f28176'
- global_system_definitions: []
* BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/

/* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
component:
- type: 'msg'
- type_id: 'msg_6e2baaf3b97dbeef01c0043275f9a0e7'
- global_messages: []
* BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/
/* clang-format on */

/***********************************************************************************************************************
* Included files
**********************************************************************************************************************/
#include "peripherals.h"

/***********************************************************************************************************************
* BOARD_InitPeripherals functional group
**********************************************************************************************************************/
/***********************************************************************************************************************
* CAN0 initialization code
**********************************************************************************************************************/
/* clang-format off */
/* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
instance:
- name: 'CAN0'
- type: 'mcan'
- mode: 'interrupts'
- custom_name_enabled: 'false'
- type_id: 'mcan_2d100a4872f8271ba5289791a0db8987'
- functional_group: 'BOARD_InitPeripherals'
- peripheral: 'CAN0'
- config_sets:
- interruptsCfg:
- txBufferInterruptSources:
- txBufferInterruptSources_L:
- 0: 'disabled'
- 1: 'disabled'
- 2: 'disabled'
- 3: 'disabled'
- 4: 'disabled'
- 5: 'disabled'
- 6: 'disabled'
- 7: 'disabled'
- 8: 'disabled'
- 9: 'disabled'
- 10: 'disabled'
- 11: 'disabled'
- 12: 'disabled'
- 13: 'disabled'
- 14: 'disabled'
- 15: 'disabled'
- txBufferInterruptSources_H:
- 0: 'disabled'
- 1: 'disabled'
- 2: 'disabled'
- 3: 'disabled'
- 4: 'disabled'
- 5: 'disabled'
- 6: 'disabled'
- 7: 'disabled'
- 8: 'disabled'
- 9: 'disabled'
- 10: 'disabled'
- 11: 'disabled'
- 12: 'disabled'
- 13: 'disabled'
- 14: 'disabled'
- 15: 'disabled'
- interrupts:
- 0:
- interrupts: ''
- enable_irq: 'false'
- interrupt_line:
- IRQn: 'CAN0_IRQ0_IRQn'
- enable_priority: 'false'
- priority: '0'
- enable_custom_name: 'false'
- 1:
- interrupts: ''
- enable_irq: 'false'
- interrupt_line:
- IRQn: 'CAN0_IRQ1_IRQn'
- enable_priority: 'false'
- priority: '0'
- enable_custom_name: 'false'
- quick_selection: 'default'
- fsl_mcan:
- mcanConfig:
- clockSource: 'FunctionClock'
- clockSourceFreq: 'BOARD_BootClockPLL180M'
- baudRateA: '500000'
- baudRateD: '500000'
- enableCanfdNormal: 'false'
- enableCanfdSwitch: 'false'
- loopBackBusMonMode: 'kMCAN_disabled'
- setNormalOperation: 'true'
- nominalBitTiming:
- seg1: '11'
- seg2: '4'
- rJumpwidth: '4'
- bitTime: []
- dataBitTiming:
- seg1: '11'
- seg2: '4'
- rJumpwidth: '4'
- bitTime: []
- messagesConfig:
- enable_custom_name: 'false'
- allocateRAM: 'true'
- stdFilter:
- listSize: '1'
- remFrame: 'kMCAN_rejectFrame'
- nmFrame: 'kMCAN_reject0'
- extFilter:
- listSize: '0'
- remFrame: 'kMCAN_rejectFrame'
- nmFrame: 'kMCAN_reject0'
- rxFifo0:
- elementSize: '1'
- watermark: '0'
- opmode: 'kMCAN_FifoBlocking'
- datafieldSize: 'kMCAN_8ByteDatafield'
- rxFifo1:
- elementSize: '0'
- watermark: '0'
- opmode: 'kMCAN_FifoBlocking'
- datafieldSize: 'kMCAN_8ByteDatafield'
- rxBuffer:
- elementSize: '0'
- datafieldSize: 'kMCAN_8ByteDatafield'
- txFifo:
- elementSize: '0'
- watermark: '0'
- txBuffer:
- dedicatedSize: '1'
- fqSize: '0'
- mode: 'kMCAN_txFifo'
- datafieldSize: 'kMCAN_8ByteDatafield'
- stdFilters: []
- extFilters: []
- quick_selection: 'default'
* BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/
/* clang-format on */
const mcan_config_t CAN0_config = {
,
,
,
.enableCanfdNormal = false,
.enableCanfdSwitch = false,
,
,
,
,
,

};
/* Allocation of the Message RAM in memory that is alligned to 16 bits. */
SDK_ALIGN(uint32_t CAN0_RAM_BASE_ADDRESS[CAN0_MESSAGE_RAM_SIZE], CAN0_BASE_ADDRESS_ALIGN_SIZE);
const mcan_timing_config_t CAN0_nominal_bit_time = {
.preDivider = 21,
.seg1 = 10,
.seg2 = 3,
.rJumpwidth = 3
};
const mcan_frame_filter_config_t CAN0_std_filter_config = {
,
,
,
,
.remFrame = kMCAN_rejectFrame,
.nmFrame = kMCAN_reject0,

};
const mcan_frame_filter_config_t CAN0_ext_filter_config = {
,
,
,
,
.remFrame = kMCAN_rejectFrame,
.nmFrame = kMCAN_reject0,

};
const mcan_rx_fifo_config_t CAN0_rx_fifo0_config = {
,
,
,
,
.opmode = kMCAN_FifoBlocking,
.datafieldSize = kMCAN_8ByteDatafield,

};
const mcan_rx_fifo_config_t CAN0_rx_fifo1_config = {
,
,
,
,
.opmode = kMCAN_FifoBlocking,
.datafieldSize = kMCAN_8ByteDatafield,

};
const mcan_rx_buffer_config_t CAN0_rx_buffers_config = {
,
,
.datafieldSize = kMCAN_8ByteDatafield,

};
const mcan_tx_fifo_config_t CAN0_tx_event_fifo_config = {
,
,
,
,

};
const mcan_tx_buffer_config_t CAN0_tx_buffers_config = {
,
,
,
,
.mode = kMCAN_txFifo,
.datafieldSize = kMCAN_8ByteDatafield,

};

void CAN0_init(void) {
/* MCAN initialization */
MCAN_Init(CAN0_PERIPHERAL, &CAN0_config, CAN0_CLOCK_SOURCE);
/* MCAN nominal (arbitration) timing initialization */
MCAN_SetArbitrationTimingConfig(CAN0_PERIPHERAL, &CAN0_nominal_bit_time);
/* Message RAM initialization */
memset(CAN0_RAM_BASE_ADDRESS, 0,CAN0_MESSAGE_RAM_SIZE * sizeof(uint32_t));
MCAN_SetMsgRAMBase(CAN0_PERIPHERAL, (uint32_t)CAN0_RAM_BASE_ADDRESS);
/* Configuration of the standard filter list */
MCAN_SetFilterConfig(CAN0_PERIPHERAL, &CAN0_std_filter_config);
/* Configuration of the extended filter list */
MCAN_SetFilterConfig(CAN0_PERIPHERAL, &CAN0_ext_filter_config);
/* Configuration of Rx FIFO 0 */
MCAN_SetRxFifo0Config(CAN0_PERIPHERAL, &CAN0_rx_fifo0_config);
/* Configuration of Rx FIFO 1 */
MCAN_SetRxFifo1Config(CAN0_PERIPHERAL, &CAN0_rx_fifo1_config);
/* Configuration of Rx buffers */
MCAN_SetRxBufferConfig(CAN0_PERIPHERAL, &CAN0_rx_buffers_config);
/* Configuration of Tx event FIFO */
MCAN_SetTxEventFifoConfig(CAN0_PERIPHERAL, &CAN0_tx_event_fifo_config);
/* Configuration of Tx buffers and FIFO/Queue */
MCAN_SetTxBufferConfig(CAN0_PERIPHERAL, &CAN0_tx_buffers_config);
/* Setting of the CAN normal mode to start communication */
MCAN_EnterNormalMode(CAN0_PERIPHERAL);
}

/***********************************************************************************************************************
* Initialization functions
**********************************************************************************************************************/
void BOARD_InitPeripherals(void)
{
/* Initialize components */
CAN0_init();
}

/***********************************************************************************************************************
* BOARD_InitBootPeripherals function
**********************************************************************************************************************/
void BOARD_InitBootPeripherals(void)
{
BOARD_InitPeripherals();
}

Why i cant use configtool starting my prephirial device?

0 Kudos

804 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,ali Karakas,

Pls check if you enable the gated clock of CAN0 module. Before you write MCAN register, you have to set the bit to enable gated clock.

Hope it can help you

BR

XiangJun Rong

pastedImage_1.png

0 Kudos

804 Views
ali3
Contributor II

i can use clock space for this. İts not any fault. But your mcu xpresso config tools generate missing code. For example i can try for i2c and usart. For this i2c and uart i can added manualy baudrate value.

0 Kudos

804 Views
ali3
Contributor II

Thanks for reply. I can manage all setitng manualy. But thisi problem is an error for this sdk. Your prephieral setting in mcuxpresso is not work .

For example if i can use this program and generate i2c or uart program cant genarate rigth code. baud setting dont generate. My be nxp is solve this problem or remove this for lpc54616. 

For beginner its bug is very big proble if use this mcu first time.

0 Kudos