Can not link FreeRTOS example project in MCUXpresso - LPC1756

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Can not link FreeRTOS example project in MCUXpresso - LPC1756

3,764件の閲覧回数
gsessa
Contributor II

Hello, I am trying to build the freertos_blinky example project on my LPC1756 with the MCUXpresso IDE.

(MCUXpresso IDE v10.3.0 [Build 2200] [2018-12-03])

The two "lpc_board_nxp_lpcxpresso_1769board" and "lpc_chip_175x_6x" libraries are correctly imported and linked, so that the build does not generate any error, even if the sources and headers are located in other projects of the same workspace.

Here I list all the operation I did:

  • Open MCUXpresso IDE in the "C:\Users\Public\FreeRTOS_test_WS" workspace folder
  • New project...
  • Under the preinstalled MCUs section, select LPC1756
  • LPCOpen - C Project
  • Project name: "FreeRTOS_test"
  • Import the "lpcopen_2_10_lpcxpresso_nxp_lpcxpresso_1769.zip" (the only one available for the 17xx family)
  • From all the available projects, import "freertos_blinky", "lpc_board_nxp_lpcxpresso_1769" and "lpc_chip_175x_6x"
  • Link the board and chip projects to the current one
  • Build project, no errors

When trying to add the "FreeRTOS.h" file, the compiler says that this file can not be found.
So I tried to import all the sources and headers from the "freertos_blinky" to my project without any luck.
I then tried to move all those files and modify all the include paths to fix all the errors, until I get these ones:

  • alloc.c:(.text._Csys_alloc+0x12): undefined reference to `__sys_appexit'
  • fpprintf.c:(.text.printf+0x50): undefined reference to `__Ciob'
  • _writebuf.c:(.text._Cwritebuf+0x14): undefined reference to `__sys_flen'
  • _writebuf.c:(.text._Cwritebuf+0x28): undefined reference to `__sys_seek'
  • fseek.c:(.text.fseek+0x1c): undefined reference to `__sys_istty'
  • fseek.c:(.text.fseek+0x92): undefined reference to `__sys_flen'

What can I do to make the freertos_blinky project visible from mine?

Am I missing something? I can not find any guide that talks about MCUXpresso, FreeRTOS and LPC17xx at the same time.

I hope for your help.

Best regards, Gioele.

ラベル(1)
9 返答(返信)

3,336件の閲覧回数
gsessa
Contributor II

Thank you both so much for your help, now everything is working.

I list all the operations I had to do:

- copy the freertos_blinky/freertos and the freertos_blinky/example folders into my project

- set the {ProjName}/freertos/src folder as a Source Folder

- link the {ProjName}/frertos/inc and {ProjName}/example/inc folders to my project into the properties panel

- change the Managed Linker Script library from Redlib (none) to Redlib (nohost)

Those modifications let me correctly compile the project with no errors.

I hope this will be useful for other people having this problem.

Thank you again for the support.

Best regards, Gioele.

0 件の賞賛
返信

3,336件の閲覧回数
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi

I just tried add freertos files to a LPCOpen demo code, I didn't see build error. I share it to you for your reference:

1. add freertos files to the project:

pastedImage_1.png

2. add the header files path to the compiler setting:

pastedImage_2.png

Then build the project. This is no error.

Please try the same.


Have a great day,
Jun Zhang

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

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 件の賞賛
返信

3,336件の閲覧回数
gsessa
Contributor II

Thank you gor your quick response.

I am using the freertos_blinky example project

I followed your steps as you can see on the folloing images:

- I copied the freertos folder into the example folder

proj_tree.PNG

- I checked the include lines and they were already ok

properties_for_freertos_blinky.PNG

After fixing all the files include paths, I have the following errors:

errors.PNG

I wonder if I followed your steps.

Best regards, Gioele.

0 件の賞賛
返信

3,336件の閲覧回数
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Gioele,

In your screenshot, the compiler can't find some symbols such as vTaskDelay. For example, vTaskDelay is defined in file task.c/task.h. these files are under freertos folder. your project Proj_piace doesn't include freertos folder files. please include them.

I also found the properties screenshot you posted is for demo code freertos_blinky. you need check same for your own project, because the errors are on your own project but not the demo code.pastedImage_1.png


Have a great day,
Jun Zhang

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

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

3,336件の閲覧回数
gsessa
Contributor II

Hi Jennie,

Thanks again for your quick and helpful reply.

I fixed the properties panel as you suggested but I had to create a new project because on the last one I had to change all the include paths and it was a little messy.

Now I have a new Proj_test with the following tree:

Proj_test-tree.PNG

I fixed the properties panel again and now I can include files like "task.h" and "FreeRTOS.h" to my project without changing all the include paths.

pastedImage_2.png

The main project file "Proj_test.c" is a copy of the "freertos_blinky.c" example, like I did on the previous project.

In the main project, the "task.h" file is correctly included, but it seems that their functions are not visible from my file.
I saw that the header was called "task.h" and the source "tasks.c", so I tried to rename the source file to match the header but the error still appears.

pastedImage_10.png


I tried then to delete those files from the project and to create new ones with the same name and content. No luck again.

I wonder if there is another step to include correctly headers with their relative sources to my project.

Have a nice day, Gioele.

0 件の賞賛
返信

3,336件の閲覧回数
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi,

In your Proj_test folder, there is no "freertos" folder and files. see below. Please add them

pastedImage_2.png

Have a great day,
Jun Zhang

 

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

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

3,336件の閲覧回数
gsessa
Contributor II

Hi,

I tried to do so, as you can see in the following screenshot, nothing changed.

tree+errors.png

I even tried to add the Proj_test/freertos/inc folder path to the properties panel nd nothing changed again.

Have a great day, Gioele.

0 件の賞賛
返信

3,336件の閲覧回数
converse
Senior Contributor V

This is because your freertos/src folder is not defined as a source folder. Only source folders are compiled, and because freertos is not being compiled, then you get these errors when linking.

To confirm this, take a look at the folder icons, you will see that there is a small blue "c" overlayed on the src folder icon, but this is not present on the freertos/src folder.

To fix this, right click on the project and select New->Source folder. In the following dialog box, Make sure the correct project name is displayed, and in the Folder Name section, Browse to the freertos/src folder and OK.

3,336件の閲覧回数
converse
Senior Contributor V
0 件の賞賛
返信