Shell problem in FRDM-K64F

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

Shell problem in FRDM-K64F

Jump to solution
1,405 Views
cleciojung
Contributor II

            Hi everyone!

 

I got a problem and I came here to ask if some of you might help me… I am using the board FRDM-K64F with the following software solutions:

KDS 3.2;

KSDK 1.3;

MQX provided by KSDK;

 

When I use the Shell() function provided by nshell  library, the exit() method of the mqx is called, and all that I see on terminal is:

Shell (build: Sep  5 201

After that, I removed the task responsible of calling the shell, and tried to include the telnet shell, but when I open the connection nothing happens, I cannot write anything, but the program does not exit.

I am providing my source code in attachment hopping that some of you might help me.

Thank you.

Original Attachment has been moved to: Test.rar

Labels (1)
0 Kudos
Reply
1 Solution
1,172 Views
cleciojung
Contributor II

   Hi everyone!

 

I finally found how to resolve this issue, by reading the document annexed. The problem was related to the order of the including libraries in the project. The mqx_stdlib should be included after the others user libraries and before toolchain libraries.

 

 Sem título.jpg

Thank you everyone for the help!

View solution in original post

0 Kudos
Reply
3 Replies
1,172 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Clecio:

I downloaded your project, unfortunately, it can't compile, because some files are symbolic links, I can't get the whole source files.

For shell ,you can refer to shell example in KSDK1.3 , I can run this demo well in my side.

KSDK_1.3.0\middleware\tcpip\rtcs\examples\shell\build\iar\shell_frdmk64f

I was informed there is a bug in KSDK1.3, please check the following, I am not sure whether it can fix your issue or not.

SDK_1.3_FRDM-K64F\utilities\shell\src\shell.c

Line 253

                context->line[context->l_pos] = 0;
//                printf("\b%s  \b", &context->line[context->c_pos]);

                  shell_printf(context, "\b%s  \b", &context->line[context->c_pos]);

Line 299

            /* move the cursor to new position */
            for (i = context->c_pos; i < context->l_pos; i++)
            {
             // printf("\b");   

            shell_printf(context, "\b");
            }

Regards

Daniel

0 Kudos
Reply
1,172 Views
cleciojung
Contributor II

Hi Daniel:

 

I did some more tests and like you, the example project work on my side too.

I am utilizing the KSDK Project Generator 2.2 to create my projects. When I include the library of shell by the normal way in kds (.a static files) the bug that I described occurs. When I use processor expert and include the library in the same way the shell works just fine. However, in the project without PEx, when I include the .c and .h files of shell in my project as if they were part of it, the project works normally. Here is a picture of what I see on my terminal screen:

 

shell.jpg

 

After the mqx exit, in the upper part of the KDS we can see the last called functions. One of them is _malloc_r(), as you can see in the image bellow, could this problem be related with the dynamic memory allocation?

 

shell2.jpg 

So again I am asking for the help of community, someone have already seen this problem?

Thanks for the help!

0 Kudos
Reply
1,173 Views
cleciojung
Contributor II

   Hi everyone!

 

I finally found how to resolve this issue, by reading the document annexed. The problem was related to the order of the including libraries in the project. The mqx_stdlib should be included after the others user libraries and before toolchain libraries.

 

 Sem título.jpg

Thank you everyone for the help!

0 Kudos
Reply