Has no member named

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

Has no member named

696 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by waynosdias on Sun Jun 21 17:53:22 MST 2015
Im getting this error DescriptionResourcePathLocationType
'LPC_IOCON_T' has no member named 'PIO1_6'ccan_rom_w.c/nxp_lpcxpresso_11c24_periph_ccan_rom/example/srcline 319C/C++ Problem

I am using the LPCOpen c_can project via LPCXresso 7.8 on the LPCXresso 11C24 board and adding uart functionality via and example from the Joseph Yiu book. Despite including the LPC11xx.h via the per file property it fails to see the LPC_ICON struct which is clearly defined in the LPC11xx.h file. If I include the header manually I get all kinds of duplicate definition errors. I have read the http://support.code-red-tech.com/CodeRedWiki/PerFileProperties and googled my brains out over this.

Original Attachment has been moved to: LPC11xx_0.h.zip

Original Attachment has been moved to: simple_uart.h.zip

0 Kudos
9 Replies

573 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by waynosdias on Mon Jun 22 19:50:45 MST 2015

Quote: R2D2

You shouldn't copy board or chip files in your project. Or older CMSIS files. That's confusing the compiler and that's confusing you  :((



You are/were so right about this. Thank you for spotting that in my project, turns out it was the linch-pin to many of the issues Ive been having. Ive forgone attempting to manually link headers and deferred solely through the project properties fx of the compiler and now all the files are playing together nice :). Just need to sort out the label decorators.
THANKS
0 Kudos

573 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by waynosdias on Mon Jun 22 07:02:03 MST 2015

Quote: R2D2

You shouldn't copy board or chip files in your project. Or older CMSIS files. That's confusing the compiler and that's confusing you  :((



Agreed :). That was my attempt to cobble things together initially. Still learning how to link w this compiler.


Quote: R2D2

If there are registers missing it's useful to add them, as described here:

http://www.lpcware.com/content/forum/forgotten-can-register-struct-lpcxpresso-lpc11c24-lpcopen-v200a



Thanks, will check it out
0 Kudos

573 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Mon Jun 22 06:51:27 MST 2015

Quote: waynosdias
So its pretty mangled.



:)

That's a cruel mixture...

You shouldn't copy board or chip files in your project. Or older CMSIS files. That's confusing the compiler and that's confusing you  :((

If it's necessary to access registers it's useful to look into Chip or Board library. There are a lot of functions available and you can also see there correct register names  ;-)

If there are registers missing it's useful to add them, as described here:

http://www.lpcware.com/content/forum/forgotten-can-register-struct-lpcxpresso-lpc11c24-lpcopen-v200a

0 Kudos

573 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by waynosdias on Mon Jun 22 05:36:26 MST 2015
Thnaks, now i can upload projects

So its pretty mangled. I deleted the simple_uart.c and most of .h out of frustration and to get you method to work
0 Kudos

573 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Sun Jun 21 23:33:36 MST 2015

Quote: waynosdias
...is there a faq for uploading the project?



Just export and upload it?

http://www.lpcware.com/content/faq/lpcxpresso/how-importexport-projects
0 Kudos

573 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by waynosdias on Sun Jun 21 23:18:51 MST 2015

Quote: R2D2


Without project I'm not sure what you are doing in detail  :((



I attempted to, but was only able to attach the source files,is there a faq for uploading the project?


Quote: R2D2

So obviously LPCOpen is now using an array (REG[]) to access IOCON registers. CMSIS was using single IOCON register names like PIO1_6.

Mixing both methods isn't recommended and usually not necessary...



I agree and think you nailed it. I am at a loss on how to rectify. Im not understanding how the compiler is linking projects/headers within the workspace.
0 Kudos

573 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Sun Jun 21 22:03:12 MST 2015

Quote: waynosdias
This works, thank you. But why doesnt what I proposed above?



Without project I'm not sure what you are doing in detail  :((

After receiving:


Quote:
LPC_IOCON_T' has no member named...



it's time to check IOCON. With 'Open declaration F3' you'll find in chip.h:

#define LPC_IOCON                 ((LPC_IOCON_T            *) LPC_IOCON_BASE)


and

LPC_IOCON_T in iocon_11xx.h:

typedef struct {/*!< LPC11XX/LPC11XXLV/LPC11UXX IOCON Structure */
__IO uint32_t  REG[48];
} LPC_IOCON_T;


So obviously LPCOpen is now using an array (REG[]) to access IOCON registers. CMSIS was using single IOCON register names like PIO1_6.

Mixing both methods isn't recommended and usually not necessary...




0 Kudos

573 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by waynosdias on Sun Jun 21 21:38:35 MST 2015

Quote: R2D2


/* Initialize debug output via UART for board */
void Board_Debug_Init(void)
{
#if defined(DEBUG_UART)
Chip_IOCON_PinMuxSet(LPC_IOCON, IOCON_PIO1_6, (IOCON_FUNC1 | IOCON_MODE_INACT)); /* RXD */
Chip_IOCON_PinMuxSet(LPC_IOCON, IOCON_PIO1_7, (IOCON_FUNC1 | IOCON_MODE_INACT)); /* TXD */

/* Setup UART for 115.2K8N1 */
Chip_UART_Init(LPC_USART);
Chip_UART_SetBaud(LPC_USART, 115200);
Chip_UART_ConfigData(LPC_USART, (UART_LCR_WLEN8 | UART_LCR_SBS_1BIT));
Chip_UART_SetupFIFOS(LPC_USART, (UART_FCR_FIFO_EN | UART_FCR_TRG_LEV2));
Chip_UART_TXEnable(LPC_USART);
#endif
}



This works, thank you. But why doesnt what I proposed above? Im really struggling w paths and inclusive errors w this compiler.
0 Kudos

573 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Sun Jun 21 19:50:17 MST 2015
What about using LPCOpen   :~

Chip_IOCON_PinMuxSet(LPC_IOCON, IOCON_PIO1_6, (IOCON_FUNC1 | IOCON_MODE_INACT)); /* RXD */


As shown in UART setup of board.c 


/* Initialize debug output via UART for board */
void Board_Debug_Init(void)
{
#if defined(DEBUG_UART)
Chip_IOCON_PinMuxSet(LPC_IOCON, IOCON_PIO1_6, (IOCON_FUNC1 | IOCON_MODE_INACT)); /* RXD */
Chip_IOCON_PinMuxSet(LPC_IOCON, IOCON_PIO1_7, (IOCON_FUNC1 | IOCON_MODE_INACT)); /* TXD */

/* Setup UART for 115.2K8N1 */
Chip_UART_Init(LPC_USART);
Chip_UART_SetBaud(LPC_USART, 115200);
Chip_UART_ConfigData(LPC_USART, (UART_LCR_WLEN8 | UART_LCR_SBS_1BIT));
Chip_UART_SetupFIFOS(LPC_USART, (UART_FCR_FIFO_EN | UART_FCR_TRG_LEV2));
Chip_UART_TXEnable(LPC_USART);
#endif
}
0 Kudos