Adding shell support to a pre-existing KSDK project.

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

Adding shell support to a pre-existing KSDK project.

Jump to solution
1,726 Views
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

Labels (1)
1 Solution
873 Views
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

View solution in original post

0 Kudos
10 Replies
873 Views
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 Kudos
873 Views
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 Kudos
873 Views
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 Kudos
873 Views
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 Kudos
873 Views
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 Kudos
873 Views
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 Kudos
874 Views
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 Kudos
873 Views
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

873 Views
ivadorazinova
NXP Employee
NXP Employee

Hello Peter Furey,

I´m preparing short guide for you.

Please, wait for a moment.

Best Regards,

Iva

873 Views
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 Kudos