Skip to content

vsnprintf_P was not declared #163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
DuyTrandeLion opened this issue Nov 30, 2017 · 6 comments
Closed

vsnprintf_P was not declared #163

DuyTrandeLion opened this issue Nov 30, 2017 · 6 comments
Labels
help wanted 🙏 Extra attention is needed question ❓ Usually converted as a discussion

Comments

@DuyTrandeLion
Copy link

Today I used a library and suddenly I received an error
error: 'vsnprintf_P' was not declared in this scope

vsnprintf_P (cmdBuf, CMD_BUFFER_SIZE, (char*)cmd, args);

So can this function be added in the core? Thank you

@fpistm
Copy link
Member

fpistm commented Nov 30, 2017

Hi,
Which library?
Those functions are part of the AVR lib.
http://www.atmel.com/webdoc/avrlibcreferencemanual/group__avr__stdio.html

All those *_P functions are intend to work with flash instead SRAM.
Currently, don't know if those functions should be added to this core ar at least reference them and point to standard one.

Ane suggestion/feedback are welcom

@fpistm fpistm added help wanted 🙏 Extra attention is needed question ❓ Usually converted as a discussion labels Nov 30, 2017
@DuyTrandeLion
Copy link
Author

Hi, thank you for your reply.

I use the WiFiEsp library https://github.com/bportaluri/WiFiEsp
This library helps controlling the esp8266 with AT command easier.

I think making a similar function is still oke then. But I don't know how the function works.

@ghost
Copy link

ghost commented Nov 30, 2017

Hi,
I use a tiny vsnprintf implementation from ST cube in the new LoRa library (see this PR)
@DuyTrandeLion I let you to look at the code and try.

@DuyTrandeLion
Copy link
Author

Thankss I will report the result later. :D

@DuyTrandeLion
Copy link
Author

The sketch compiled successfully but I haven't tested all function. Oh I am using the Nucleo-L432KC, so can I use Serial1? I saw that I can enable USART1 to 3.
And about ADC, does the ADC automatically generate an interrupt when I call the function? I wonder if it works like using the STM32CubeMX

@fpistm
Copy link
Member

fpistm commented Nov 30, 2017

Yes you can use the Serial1. By selecting the 'Enable first third' in 'Serial interface' menu, Serial1 will be instantiate.
By default, the Rx/Tx used will be the first one found in the PinMap_UART_RX[]/TX[] in PeripheralPins.c file for USART1 peripheral.
So, for L432: PA10/PA9.
You could change it before call Serial1.begin() thanks:

Serial1.setRx(PB7);
Serial1.setTx(PB6);

About ADC, If you talk about analogRead(), there is no interrupt.
We are currently working on extended ADC API.

fpistm added a commit to fpistm/Arduino_Core_STM32 that referenced this issue Dec 5, 2017
Based on Paul Stoffregen work on Teensy 3 (http://pjrc.com)

Fix stm32duino#163

Signed-off-by: Frederic.Pillon <[email protected]>
benwaffle pushed a commit to benwaffle/Arduino_Core_STM32 that referenced this issue Apr 10, 2019
Based on Paul Stoffregen work on Teensy 3 (http://pjrc.com)

Fix stm32duino#163

Signed-off-by: Frederic.Pillon <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted 🙏 Extra attention is needed question ❓ Usually converted as a discussion
Projects
None yet
Development

No branches or pull requests

2 participants