I have two LPC-Link2 boards; one as the debugger and one as the target.
MCUXpresso IDE v10.2.0 [Build 759] [2018-05-15] .
Thanks to the NXP community I now have Fast GPIO (100MHz) and HSADC (80Msps).
I now also have a massive array full of data which I want to output to a format I can use to evaluate it.
As yet I've not managed to get data output to the Debug Console and need some help getting it running.
I went back a step and started with the periph_systick example.
Set the library as Redlib semihost (in Settings->MCU Linker->Managed Linker Script)
Added the following to the code and run.
DEBUGINIT();
DEBUGOUT("talk\r\n");
printf("talk\r\n");
The Debugger Console output has some information regarding the status of the debug but none of the 'user' output data.
GNU gdb (GNU Tools for Arm Embedded Processors 7-2017-q4-major) 8.0.50.20171128-git
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-w64-mingw32 --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".Program stopped.
0x10402d62 in ?? ()
No line 85 in file "C:/nxp/workspace/periph_systick/src/systick.c".Temporary breakpoint 2, main () at ../src/systick.c:72
72 SystemCoreClockUpdate();
Note: automatically using hardware breakpoints for read-only addresses.Breakpoint 4, main () at ../src/systick.c:83
83 DEBUGOUT("talk\r\n");Breakpoint 3, main () at ../src/systick.c:84
84 printf("talk\r\n");
What obvious thing have I missed this time?
Full code below:
int main(void)
{SystemCoreClockUpdate();
Board_Init();DEBUGINIT();
DEBUGOUT("talk\r\n");
printf("talk\r\n");/* Enable and setup SysTick Timer at a periodic rate */
SysTick_Config(SystemCoreClock / TICKRATE_HZ);while (1) {
DEBUGOUT("talk\r\n");
printf("talk\r\n");
__WFI();
}
}
Thanks, Simon.
解決済! 解決策の投稿を見る。
So I have just gone through the process as follows:
Then after doing a full clean build of the projects, I get semihosted printf output when debugging "periph_blinky"
Regards,
MCUXpresso IDE Support
So I have just gone through the process as follows:
Then after doing a full clean build of the projects, I get semihosted printf output when debugging "periph_blinky"
Regards,
MCUXpresso IDE Support
Thank you!
I started with a new/empty workspace folder, followed your instructions and everything worked.
Not sure if my problem is due to starting with lpcopen_3_02_lpcxpresso_link2_4370.zip or if the projects were not being cleaned sufficiently.
Just one more thing, when I don't comment out "retarget.h" where is the UART output on the LPC-Link2 board?
If this is too much of a major follow-up question I'll post a new one.
Found it. Thanks.
/**
* @brief Initialize the UART interface
* @param pUART : Pointer to UART register interface used on this board
* @return Nothing
* @note This function will currently support USART2 only, it will setup
* USART2 pin mux [P2.10 : UART2_TXD J3 -> Pin 8, P2.11 :
* UART2_RXD -> J3 Pin-7]. For other UART/USART the application
* should setup pin-muxing on its own.
*/
void Board_UART_Init(LPC_USART_T *pUART);
Double check that you have cleaned and then rebuilt both your library projects as well as the main application project after making the changes.
Regards,
MCUXpresso IDE Support
Hi, That's a fair suggestion.
I made a change to board.c to remove the call to DEBUGINIT(), then cleaned ALL projects and rebuilt periph_systick.
Stepping through the code although the code view is correct it is still running against old code.
You can see it in the images below as it has hit a line of code I've removed.
Even though its commented out, it hits DEBUGINIT() and therefore Board_Debug_Init().
Are there other project files which require deleting outside of "clean"?
By default, your LPCOpen board library will probably be redirecting printf to UART. For details of how to change this, see section 15.5.4, "Printf when using LPCOpen", of the MCUXpresso IDE v10.2 User Guide.
In addition, if you are going to output a large amount of data, you might also want to use the Semihost-mb-nf variant of the library in order to increase the output speed.
Regards,
MCUXpresso IDE Support
Hi, Thank you for the recommendation.
I've gone to the manual as you suggested and have set the following (shown below).
Sadly I still get no Debugger Console output
When stepping through the Board_Init()->DEBUGINIT() code
it still hits the UART initialisation in Board_Debug_Init()
which surprises me as it looks like this should not be called.