KW38A PRINTF() didn't work

cancel
Showing results for 
Search instead for 
Did you mean: 

KW38A PRINTF() didn't work

Jump to solution
215 Views
Andy_Wang_JP
Contributor II

Hi NXP Team :

I'm development of new project on KW38A recently.I got a issue which is the PRINTF() function can't work after I flashing firmware.But It could work in DEBUG mode(by using PEmicro probe).

This is my hardware condition below:

1.The schematic of my PCBA I use which is follow the FRDM-KW38 EVB,except for The OpenSDA component doesn't on it.

2.There is UART model header on my board, and the connection of Tx/Rx pin is correct.  

Please guide me how to fix this problem.

Thanks 

Andy

Tags (1)
0 Kudos
1 Solution
183 Views
EduardoZamora
NXP Employee
NXP Employee

Hi,

Please, take a look at these Design Considerations. Here you can find some useful information such as the Hardware Design Considerations for MKW39A/38A/37A/38Z/37Z.

Also, please compare your schematic with the FRDM-KW38 schematic (inside the Hardware Design Files); pay attention to the NMI pin. By any chance, does your custom design include a pull-up resistor connected to this pin?

Regards,
Eduardo.

View solution in original post

0 Kudos
6 Replies
208 Views
EduardoZamora
NXP Employee
NXP Employee

Hello Andy,

Hope you are doing well.

Could you please help us with more details about your print interface?

The FRDM-KW38 EVB OpenSDA Interface routes both SWD and UART to an USB interface, which makes the console printing possible using any of these interfaces as a source. If you exclude the OpenSDA Interface and use semihosting for printing data over SWD port, you may be able to see data by using a debug probe.

If your application is intended to print data in console (on your PC) you may need to implement an external UART to USB converter when using UART for serial printing. Also, if you are using a SDK example project, please note that UART should be selected in Project Options when importing the example:

EduardoZamora_0-1660585124969.png

Best regards,
Eduardo.

0 Kudos
204 Views
Andy_Wang_JP
Contributor II

Hi  Eduardo Zamora

Thanks for your quick reply.

And Yes, I want to print data on PC, so let me describe more detail about my project.

About Connection:

PC-->Multilink(as firmware flash and debug tool)-->My board's SWD port.

PC-->FTDI USB to UART cable(Using Putty as console)-->My board's UART Pin Header.

About Project :

I import [ frdmkw38_hello_world ] project to test my board as basic test(pin config/clock config etc.....),and I'm sure I've chosen UART as Debug console when I import the project.

Andy_Wang_JP_0-1660610507628.png

About the problem :

When I flash the Hello World project into my board,and reboot it,the putty didn't print out the word.

So I use my Multilink to get into Debug mode,and use [Step Over(F6)] then that it run over PRINTF function,and the [hello word] was printed out and display on Putty.

Andy_Wang_JP_0-1660613323852.png

Normal, if everything is fine, I just flash the firmware into my board and reboot, it should print out data,but now it can print out only if it get into debug mode.
That's the issue what i got.
Thanks and waiting for next guide.
Andy

 

0 Kudos
196 Views
EduardoZamora
NXP Employee
NXP Employee

Hello,

Would it be possible for you to check your UART signals/pins with a logic analyzer? This to confirm the behavior that your applications presents.

Also, just to verify that the UART interface works properly, could you please import and test the lpuart_interrupt example project (or related)? You can find it inside driver_examples > lpuart. Please follow the instructions inside the doc > readme.txt file of the corresponding project.

Regards,
Eduardo.

0 Kudos
191 Views
Andy_Wang_JP
Contributor II

Hi,

For some reasons I don't have logic analyzer now,but I did test related UART(frdmkw38_lpuart_polling / frdmkw38_lpuart_interrupt etc...),it's still the same problem.It only print out if I get into debug mode.

But I got something new that is different about my issue. If I flash the wireless sample project,for example : frdmkw38_temperature_collector_bm or frdmkw38_temperature_sensor_bm, it can print out the message immediately after I flash the firmware. 

Is that possible I need to modify the hardware for these two variety of projects? or modify the project setting? 

Thanks for your support.                                                                                                                               Regards

Andy

 

0 Kudos
184 Views
EduardoZamora
NXP Employee
NXP Employee

Hi,

Please, take a look at these Design Considerations. Here you can find some useful information such as the Hardware Design Considerations for MKW39A/38A/37A/38Z/37Z.

Also, please compare your schematic with the FRDM-KW38 schematic (inside the Hardware Design Files); pay attention to the NMI pin. By any chance, does your custom design include a pull-up resistor connected to this pin?

Regards,
Eduardo.

0 Kudos
171 Views
Andy_Wang_JP
Contributor II

Hi 

Sorry for replying late and thanks for your suggestion. I've compared my schematic with the FRDM-KW38 schematic.Our hardware co-workers found something wrong....
Yes,the NMI pin was pulled high,because all the push button pins on the FRDM-KW38 that we collect it then turn into DIP switch on my board.And the original state of the DIP switch was all pulled high, which means the NMI pin(PTB18, SW3 on the FRDM-KW38 ) was high state.That's the main reason which cause my issue.
Thanks for your support,I've learned a treasure lesson.

Regards

Andy