IAR Workbench Error [Li005] while copying files between examples

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
RoCo_4660301
Level 1
Level 1
5 replies posted 5 questions asked First reply posted

I'm having the following error:

Error[Li005]: no definition for "Mfs_Uart_Init" [referenced from C:\Users\rcorder1\Documents\IAR Embedded 

Workbench\GPIO & ADC\arm\8.50.1\Cypress\s6j3200\S6J3260Evl\examples\adc12b\single_irq_sw\TCFLASH 

Debug\Obj\main.o]

Error[Li005]: no definition for "Mfs_Uart_Write" [referenced from C:\Users\rcorder1\Documents\IAR Embedded 

Workbench\GPIO & ADC\arm\8.50.1\Cypress\s6j3200\S6J3260Evl\examples\adc12b\single_irq_sw\TCFLASH 

Debug\Obj\main.o]

Error[Li005]: no definition for "Mfs_Uart_Read" [referenced from C:\Users\rcorder1\Documents\IAR Embedded 

Workbench\GPIO & ADC\arm\8.50.1\Cypress\s6j3200\S6J3260Evl\examples\adc12b\single_irq_sw\TCFLASH 

Debug\Obj\main.o]

Error while running Linker

I'm trying to "merge/combine" the ADC and UART examples for Cypress s6j3200

Using Windows 10, IAR Arm 8.50.1

Build log:

Building configuration: single_irq_sw - TCFLASH Debug

Updating build tree...

Linking

ilinkarm.exe C:\Users\rcorder1\Documents\IAR Embedded Workbench\GPIO & ADC\arm\8.50.1\Cypress\s6j3200\

S6J3260Evl\examples\adc12b\single_irq_sw\TCFLASH Debug\Obj\adc12b.o C:\Users\rcorder1\Documents\IAR 

Embedded Workbench\GPIO & ADC\arm\8.50.1\Cypress\s6j3200\S6J3260Evl\examples\adc12b\single_irq_sw\

TCFLASH Debug\Obj\exceptions.o C:\Users\rcorder1\Documents\IAR Embedded Workbench\GPIO & ADC\arm\

8.50.1\Cypress\s6j3200\S6J3260Evl\examples\adc12b\single_irq_sw\TCFLASH Debug\Obj\flash_marker.o C:\

Users\rcorder1\Documents\IAR Embedded Workbench\GPIO & ADC\arm\8.50.1\Cypress\s6j3200\S6J3260Evl\

examples\adc12b\single_irq_sw\TCFLASH Debug\Obj\interrupts.o C:\Users\rcorder1\Documents\IAR Embedded 

Workbench\GPIO & ADC\arm\8.50.1\Cypress\s6j3200\S6J3260Evl\examples\adc12b\single_irq_sw\TCFLASH 

Debug\Obj\main.o C:\Users\rcorder1\Documents\IAR Embedded Workbench\GPIO & ADC\arm\8.50.1\Cypress\

s6j3200\S6J3260Evl\examples\adc12b\single_irq_sw\TCFLASH Debug\Obj\mfs_uart.o C:\Users\rcorder1\

Documents\IAR Embedded Workbench\GPIO & ADC\arm\8.50.1\Cypress\s6j3200\S6J3260Evl\examples\adc12b\

single_irq_sw\TCFLASH Debug\Obj\pdl.o C:\Users\rcorder1\Documents\IAR Embedded Workbench\GPIO & ADC\

arm\8.50.1\Cypress\s6j3200\S6J3260Evl\examples\adc12b\single_irq_sw\TCFLASH Debug\Obj\port.o C:\Users\

rcorder1\Documents\IAR Embedded Workbench\GPIO & ADC\arm\8.50.1\Cypress\s6j3200\S6J3260Evl\examples\

adc12b\single_irq_sw\TCFLASH Debug\Obj\start.o C:\Users\rcorder1\Documents\IAR Embedded Workbench\

GPIO & ADC\arm\8.50.1\Cypress\s6j3200\S6J3260Evl\examples\adc12b\single_irq_sw\TCFLASH Debug\Obj\

startup.o C:\Users\rcorder1\Documents\IAR Embedded Workbench\GPIO & ADC\arm\8.50.1\Cypress\s6j3200\

S6J3260Evl\examples\adc12b\single_irq_sw\TCFLASH Debug\Obj\sysctrl.o C:\Users\rcorder1\Documents\IAR 

Embedded Workbench\GPIO & ADC\arm\8.50.1\Cypress\s6j3200\S6J3260Evl\examples\adc12b\single_irq_sw\

TCFLASH Debug\Obj\Traveo_template_version.o --no_out_extension -o C:\Users\rcorder1\Documents\IAR 

Embedded Workbench\GPIO & ADC\arm\8.50.1\Cypress\s6j3200\S6J3260Evl\examples\adc12b\single_irq_sw\

TCFLASH Debug\Exe\single_irq_sw.out --redirect _Printf=_PrintfFullNoMb --redirect _Scanf=_ScanfFullNoMb --map 

C:\Users\rcorder1\Documents\IAR Embedded Workbench\GPIO & ADC\arm\8.50.1\Cypress\s6j3200\S6J3260Evl\

examples\adc12b\single_irq_sw\TCFLASH Debug\List\single_irq_sw.map --config C:\Program Files (x86)\IAR 

Systems\Embedded Workbench 8.4\arm\config\linker\Cypress\s6j33xDx.icf --semihosting --entry 

__iar_program_start --vfe --text_out locale

   IAR ELF Linker V8.50.1.245/W32 for ARM

   Copyright 2007-2020 IAR Systems AB.

Error[Li005]: no definition for "Mfs_Uart_Init" [referenced from C:\Users\rcorder1\Documents\IAR Embedded 

Workbench\GPIO & ADC\arm\8.50.1\Cypress\s6j3200\S6J3260Evl\examples\adc12b\single_irq_sw\TCFLASH 

Debug\Obj\main.o]

Error[Li005]: no definition for "Mfs_Uart_Write" [referenced from C:\Users\rcorder1\Documents\IAR Embedded 

Workbench\GPIO & ADC\arm\8.50.1\Cypress\s6j3200\S6J3260Evl\examples\adc12b\single_irq_sw\TCFLASH 

Debug\Obj\main.o]

Error[Li005]: no definition for "Mfs_Uart_Read" [referenced from C:\Users\rcorder1\Documents\IAR Embedded 

Workbench\GPIO & ADC\arm\8.50.1\Cypress\s6j3200\S6J3260Evl\examples\adc12b\single_irq_sw\TCFLASH 

Debug\Obj\main.o]

  8'058 bytes of readonly  code memory

  1'214 bytes of readonly  data memory

  3'390 bytes of readwrite data memory

Errors: 3

Warnings: none

Link time:   0.08 (CPU)   0.06 (elapsed)

Error while running Linker

Total number of errors: 3

Total number of warnings: 0

Build failed.

0 Likes
1 Solution
Ashish
Moderator
Moderator
Moderator
25 likes received 50 solutions authored 100 replies posted

Hi,

This error arises because following functions are not defined : Mfs_Uart_Init, Mfs_Uart_Write, Mfs_Uart_Read but are being used in your main.c file. These functions are defined in mfs_uart.h file , so you need to  make sure this is added to the project.  If not added, you can provide the path to the header in : [right click on project] -> options -> C/C++ Compiler -> preprocessors

Alternatively, you can just check pdl_user.h for both uart and adc. Based on that I found following PDL should be enabled, so make sure that your pdl_user.h has:

#define PDL_PERIPHERAL_ENABLE_ADC12B          PDL_ON

#define PDL_PERIPHERAL_ENABLE_SYSCTRL        PDL_ON

#define PDL_PERIPHERAL_ENABLE_UART0             PDL_ON

#define PDL_PERIPHERAL_ENABLE_PORT               PDL_ON

Regards,

Ashish

#define PDL_PERIPHERAL_ENABLE_UART0             PDL_ON

View solution in original post

4 Replies
Ashish
Moderator
Moderator
Moderator
25 likes received 50 solutions authored 100 replies posted

Hi,

This error arises because following functions are not defined : Mfs_Uart_Init, Mfs_Uart_Write, Mfs_Uart_Read but are being used in your main.c file. These functions are defined in mfs_uart.h file , so you need to  make sure this is added to the project.  If not added, you can provide the path to the header in : [right click on project] -> options -> C/C++ Compiler -> preprocessors

Alternatively, you can just check pdl_user.h for both uart and adc. Based on that I found following PDL should be enabled, so make sure that your pdl_user.h has:

#define PDL_PERIPHERAL_ENABLE_ADC12B          PDL_ON

#define PDL_PERIPHERAL_ENABLE_SYSCTRL        PDL_ON

#define PDL_PERIPHERAL_ENABLE_UART0             PDL_ON

#define PDL_PERIPHERAL_ENABLE_PORT               PDL_ON

Regards,

Ashish

#define PDL_PERIPHERAL_ENABLE_UART0             PDL_ON

When you say provide the path to the header it is include it in "Additional include directories" or "Preinclude file"?

0 Likes

Thanks, second option worked. Still going to be searching for doing something similar to first option.

0 Likes
Ashish
Moderator
Moderator
Moderator
25 likes received 50 solutions authored 100 replies posted

Hi,

Glad to know that it worked! For the first option, you can provide the path to all the necessary headers to "Additional include directories" and include the corresponding header in main.c file. For your case, I think second option is straight forward and better to use. It's very helpful when you merge multiple files and you need not to add headers for each file separately, instead pdl_user.h will take care of it.

Regards,

Ashish

0 Likes