Console printing

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Console printing

1,464件の閲覧回数
muis
Contributor II

Using LPCExpresso I was able to use this code to print directly to the console:

#define LIBSTUB_SYS_WRITE __write

But using MCUExpresso it cannot compile because __write seems undefined?

Normally this is caused when you disable semihosting, but its enabled now, so how to upgrade my code?

ラベル(1)
タグ(1)
2 返答(返信)

1,029件の閲覧回数
muis
Contributor II

The alias was still present in the latest release of LPCXpresso (v8.2.2), but I changed it to __sys_* and it compiles again, so thanks for your help.

0 件の賞賛

1,028件の閲覧回数
lpcxpresso_supp
NXP Employee
NXP Employee

You need to use the symbol __sys_write (as described in section 11.5.6, "Retargeting printf/scanf", of the MCUXpresso IDE v10.0.2 User Guide).

IIRC __write was renamed to __sys_write back in the days of Red Suite 3 or 4 when the whole semihosting layer was reworked. It is possible the symbol was still there as an alias in later LPCXpresso IDE versions until some more recent tidy up work.

Regards,

MCUXpresso IDE Support