Jlink semihost issue

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

Jlink semihost issue

Jump to solution
429 Views
Vandarkholme
Contributor II

hello! I'm use printf function to print message on console, but not worked. My debugger is Jlink V9,  here is my project settings:

Vandarkholme_0-1721369515836.png

 

Vandarkholme_1-1721369550737.pngVandarkholme_2-1721369560027.png

Vandarkholme_3-1721369834986.png

 

So, is there anyway to print messages on s32ds console? Or only use uart/RTT?

S32DS-S32PLATFORM 

0 Kudos
Reply
1 Solution
389 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Vandarkholme,

Please enable semihosting by declaring and calling initialise_monitor_handles().

#include "Mcal.h"
#include "stdio.h"

volatile int exit_code = 0;
int counter, limit_value = 1000000;
extern void initialise_monitor_handles(void);

int main(void)
{
	initialise_monitor_handles();
    for(;;)
    {
    	counter++;
        if(counter >= limit_value)
        {
            counter = 0;
            printf("Hello World\n");
        }
    }
    return exit_code;
}

Also, make sure that a library that supports semihosting is configured:

Julin_AragnM_0-1721686355115.png

Julin_AragnM_1-1721686368854.png

Best regards,
Julián

View solution in original post

0 Kudos
Reply
2 Replies
390 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Vandarkholme,

Please enable semihosting by declaring and calling initialise_monitor_handles().

#include "Mcal.h"
#include "stdio.h"

volatile int exit_code = 0;
int counter, limit_value = 1000000;
extern void initialise_monitor_handles(void);

int main(void)
{
	initialise_monitor_handles();
    for(;;)
    {
    	counter++;
        if(counter >= limit_value)
        {
            counter = 0;
            printf("Hello World\n");
        }
    }
    return exit_code;
}

Also, make sure that a library that supports semihosting is configured:

Julin_AragnM_0-1721686355115.png

Julin_AragnM_1-1721686368854.png

Best regards,
Julián

0 Kudos
Reply
374 Views
Vandarkholme
Contributor II

@Julián_AragónM  thanks! Very useful!

Vandarkholme_0-1721698642878.png

 

0 Kudos
Reply