Adding shell support to a pre-existing KSDK project.

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Adding shell support to a pre-existing KSDK project.

跳至解决方案
3,353 次查看
peterfurey
Contributor IV

Hello,

I'm using KDS_3.0.0, KSDK_1.2.0, and the FRDM-K64F board.

I created a project by importing and modifying the hello_frdmk64f project into my workspace.

My new project runs fine. However, I'm having trouble adding shell support to this new project.

Is there a straight forward way to add some of the basic functionality provided in ${KSDK_1.2.0}/rtos/mqx/nshell ?

Obviously I'm new to these tools and can't find any documentation or forum discussions on it?

My initial attempts to wing it have come up short.

Thanks,

Peter

标签 (1)
1 解答
2,500 次查看
ivadorazinova
NXP Employee
NXP Employee

Hi Peter,

actually there is guide, how to set up the demo and modified it.

In the second part I will describe how to set it to existing project/new project.

Adding TAD shell in KSDK shell demo - PART 1

Best Regards,
Iva

在原帖中查看解决方案

0 项奖励
回复
10 回复数
2,500 次查看
ivadorazinova
NXP Employee
NXP Employee

Dear Peter Furey,

thank you for your good question.

Please, have you tried demo for shell? The demo is located at C:\Freescale\KSDK_1.2.0\middleware\tcpip\rtcs\examples\shell\build\iar\shell_frdmk64f

In file demo_cmd.c are shell commands.

This file you can added to enable/disable commands (echo,copy,create,format......) to your project.

commands.png

I hope it helps you,

Iva

0 项奖励
回复
2,500 次查看
peterfurey
Contributor IV

Hi Iva,

My question was sort of vague, I wanted to know how I determine
the paths and libraries to include when you want shell support (or any other
feature). The only way I’ve figured things out is by trying to find other projects
that sort of do similar things and infer it from that. But it’s really hard and
time consuming to do it that way. I realize that KDS is still in its infancy
though.

I've tried for over a day to get the Shell_tad command to work but get the following linker error.

I can't find any example projects using this functionality, so it's hard to figure out what I'm missing.

C:/Freescale/KSDK_1.2.0/rtos/mqx/lib/frdmk64f.kds/debug/nshell/lib_nshell.a(sh_tad.o): In function `Shell_tad':

C:/Freescale/KSDK_1.2.0/rtos/mqx/nshell/source/mqx/sh_tad.c:58: undefined reference to `_tad_stack_usage'

C:/Freescale/KSDK_1.2.0/rtos/mqx/nshell/source/mqx/sh_tad.c:59: undefined reference to `_tad_lightweight_memory_blocks'

C:/Freescale/KSDK_1.2.0/rtos/mqx/nshell/source/mqx/sh_tad.c:65: undefined reference to `_tad_stack_usage'

C:/Freescale/KSDK_1.2.0/rtos/mqx/nshell/source/mqx/sh_tad.c:69: undefined reference to `_tad_lightweight_memory_blocks'

collect2.exe: error: ld returned 1 exit status

make: *** [mission_controller_proto.elf] Error 1

Is it obvious what I'm missing from my project properties?

0 项奖励
回复
2,500 次查看
ivadorazinova
NXP Employee
NXP Employee

Hello Peter,

please, just for information, have you included to your project in IAR/KDS tad.h and do you have set path in linker?

I mean:

tad.h.png

Thank you for your feedback!

Iva

0 项奖励
回复
2,500 次查看
peterfurey
Contributor IV

Hello Iva,

I tried that and I still get the same error. Another thing that I've noticed is that TAD does not appear to be working with the shell_frdmk64f project either. When I try to list tasks after launching shell_frdm64f, it displays "Task list not retrieved successfully". MQX Task Queues displays "Task queues not installed!", MQX Stack Usage displays "Stack usage information not found!", etc.

So I suspect there is a problem with TAD working with KDS.

I have the following versions:

KDS_3.0.0, KSDK_1.2.0, and the FRDM-K64F board.

Thanks for your help,

Peter

0 项奖励
回复
2,500 次查看
ivadorazinova
NXP Employee
NXP Employee

Hello Peter,

I apologize for my late response - I was out of my office,

please, is your issue still actual? Does it persist?

Thank you for your feedback!

Iva

0 项奖励
回复
2,500 次查看
peterfurey
Contributor IV

Hi again,

Maybe if you could point me to a project that uses the Shell_tad command I could figure it out.

However, I haven't found a project that uses Shell_tad in KSDK_1.2.0

Thanks,

Peter

0 项奖励
回复
2,501 次查看
ivadorazinova
NXP Employee
NXP Employee

Hi Peter,

actually there is guide, how to set up the demo and modified it.

In the second part I will describe how to set it to existing project/new project.

Adding TAD shell in KSDK shell demo - PART 1

Best Regards,
Iva

0 项奖励
回复
2,500 次查看
peterfurey
Contributor IV

Hello Iva,

Step 3 in the guide resolved my issue:

3. Open tad.c (located at /mqx_frdmk64f/MQX_Generic/tad/tad.c) and remove at the first line:

      #if MQX_USE_IO_OLD

and last line

       #endif // MQX_USE_IO_OLD

and included fio library

      #include <fio.h> 

tad is now working in my shell task.

Thank you,

Peter

2,500 次查看
ivadorazinova
NXP Employee
NXP Employee

Hello Peter Furey,

I´m preparing short guide for you.

Please, wait for a moment.

Best Regards,

Iva

2,500 次查看
peterfurey
Contributor IV

Hi Iva,

Yes, I still have something wrong with my build configuration.

Thanks,

Peter

'Building target: mission_controller_proto.elf'

'Invoking: Cross ARM C++ Linker'

arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections  -g3 -T "C:\Freescale\KSDK_1.2.0\platform\devices\MK64F12\linker\gcc\MK64FN1M0xxx12_flash.ld" -nostartfiles -nodefaultlibs -Xlinker --gc-sections -L"C:\Freescale\KSDK_1.2.0\middleware\filesystem\mfs\lib\frdmk64f.kds\debug\mfs" -L"C:\Freescale\KSDK_1.2.0\rtos\mqx\mqx\source\tad\tad.h" -LC:/Freescale/KSDK_1.2.0/lib/ksdk_mqx_lib/kds/K64F12/debug -L"C:\Freescale\KSDK_1.2.0\rtos\mqx\lib\frdmk64f.kds\debug\nshell" -L"C:\Freescale\KSDK_1.2.0\rtos\mqx\lib\frdmk64f.kds\debug\mqx" -L"C:\Freescale\KSDK_1.2.0\rtos\mqx\lib\frdmk64f.kds\debug\mqx_stdlib" -Wl,-Map,"mission_controller_proto.map" -Xlinker --cref -Xlinker -static  -Xlinker -z -Xlinker muldefs  -Xlinker --undefined=__isr_vector  -Xlinker --defsym=__stack_size__=0x400  -Xlinker --defsym=__heap_size__=0x200 -o "mission_controller_proto.elf"  ./Sources/battery_task.o ./Sources/initialization_task.o ./Sources/main.o ./Sources/pressure_task.o ./Sources/shell_altitude.o ./Sources/shell_attitude.o ./Sources/shell_task.o ./Sources/shell_vacuum.o ./Sources/shutdown_task.o  ./KSDK_Files/board.o ./KSDK_Files/gpio_pins.o ./KSDK_Files/pin_mux.o  ./Debug_Console/fsl_debug_console.o ./Debug_Console/fsl_misc_utilities.o ./Debug_Console/print_scan.o  ./BSP_Files/init_bsp.o ./BSP_Files/mqx_main.o  C:/Freescale/KSDK_1.2.0/middleware/filesystem/mfs/lib/frdmk64f.kds/debug/mfs/lib_mfs.a C:/Freescale/KSDK_1.2.0/rtos/mqx/mqx/source/tad/tad.h C:/Freescale/KSDK_1.2.0/lib/ksdk_mqx_lib/kds/K64F12/debug/libksdk_platform_mqx.a C:/Freescale/KSDK_1.2.0/rtos/mqx/lib/frdmk64f.kds/debug/nshell/lib_nshell.a C:/Freescale/KSDK_1.2.0/rtos/mqx/lib/frdmk64f.kds/debug/mqx/lib_mqx.a C:/Freescale/KSDK_1.2.0/rtos/mqx/lib/frdmk64f.kds/debug/mqx_stdlib/lib_mqx_stdlib.a -lksdk_platform_mqx -l_mfs -l_nshell -l_mqx -l_mqx_stdlib -lgcc -lc -lsupc++ -lm -lnosys

C:/Freescale/KSDK_1.2.0/rtos/mqx/lib/frdmk64f.kds/debug/nshell/lib_nshell.a(sh_tad.o): In function `Shell_tad':

C:/Freescale/KSDK_1.2.0/rtos/mqx/nshell/source/mqx/sh_tad.c:58: undefined reference to `_tad_stack_usage'

C:/Freescale/KSDK_1.2.0/rtos/mqx/nshell/source/mqx/sh_tad.c:59: undefined reference to `_tad_lightweight_memory_blocks'

C:/Freescale/KSDK_1.2.0/rtos/mqx/nshell/source/mqx/sh_tad.c:65: undefined reference to `_tad_stack_usage'

C:/Freescale/KSDK_1.2.0/rtos/mqx/nshell/source/mqx/sh_tad.c:69: undefined reference to `_tad_lightweight_memory_blocks'

collect2.exe: error: ld returned 1 exit status

make: *** [mission_controller_proto.elf] Error 1

0 项奖励
回复