Jlink semihost issue

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
427件の閲覧回数
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 件の賞賛
返信
1 解決策
387件の閲覧回数
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 件の賞賛
返信
2 返答(返信)
388件の閲覧回数
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 件の賞賛
返信
372件の閲覧回数
Vandarkholme
Contributor II

@Julián_AragónM  thanks! Very useful!

Vandarkholme_0-1721698642878.png

 

0 件の賞賛
返信