You are here

printf / scanf functions in Imagecraft compiler | Cypress Semiconductor

Support & Community

printf / scanf functions in Imagecraft compiler

Last Updated: March 15, 2010
Answer: 

Question: Are printf / scanf functions supported in Imagecraft compiler?

Response: Yes.  PSoC Designer 5.0 SP6 (which includes Imagecraft compiler version 7.02.004) supports the printf/scanf functions.  Due to code size requirement, the printf/scanf functions are supported in the following three forms.

1. Basic with no long / floating point, or modifier,
2. Support for long , and
3. Support for floating point.

By default the option 1 is supported. To use option 2 or 3 the following changes are required in the compiler settings.

Support for float:
1. Open local.mk file from "Projects" tab in PSoC Designer. If local.mk file is not already available, create a text file called local.mk in the project directory.
2. At the bottom of local.mk, add CODECOMPRESSOR:=$(CODECOMPRESSOR) -lfpm8c  (this will link the libfpm8c.a, which contains the floating point capability of printf/scanf with modifier support)
3. Save local.mk file and build the project.

More code and data/stack space are needed for the fully featured versions (for the support of long and float).

Support for long:
1. Open local.mk file from "Projects" tab in PSoC Designer. If local.mk file does not already exist, create a text file called local.mk in the project directory.
2. At the bottom of local.mk, add CODECOMPRESSOR:=$(CODECOMPRESSOR) -llpm8c  (this will link the liblpm8c.a , which contains the long data type capability of printf/scanf)
3. Save local.mk file and build the project.

Provide feedback on this article

Browse KB By Product

Browse KB by Type