Page 1 of 1

HCMODU0138 Serial MP3 player and ESP

Posted: Fri Dec 30, 2022 8:42 am
by Megabyte
Hello
I've just received my HCMODU0138 Serial MP3 playback module and want to put it to use. I prefer the ESP8266 or ESP32 devices over the Arduino boards but am unable to compile the HCMP3 example sketch using the Arduino IDE (it compiles OK for an UNO board). I'm getting this from the compiler:
In file included from C:\Users\Martin\Documents\Arduino\libraries\HCMP3\HCMP3.h:37,
from C:\Users\Martin\Documents\Arduino\libraries\HCMP3\HCMP3.cpp:34:
C:\Users\Martin\Documents\Arduino\libraries\HCMP3\HCMP3.cpp: In constructor 'HCMP3::HCMP3(uint8_t, uint8_t)':
C:\Users\Martin\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266/Arduino.h:201:60: error: cannot convert 'volatile uint32_t*' {aka 'volatile unsigned int*'} to 'volatile uint8_t*' {aka 'volatile unsigned char*'} in assignment
201 | #define portOutputRegister(port) (((port)==_PORT_GPIO16)?((volatile uint32_t*) &GP16O):((volatile uint32_t*) &GPO))
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| volatile uint32_t* {aka volatile unsigned int*}
C:\Users\Martin\Documents\Arduino\libraries\HCMP3\HCMP3.cpp:47:12: note: in expansion of macro 'portOutputRegister'
47 | _txPort = portOutputRegister(digitalPinToPort(txPin));
| ^~~~~~~~~~~~~~~~~~
C:\Users\Martin\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266/Arduino.h:202:60: error: cannot convert 'volatile uint32_t*' {aka 'volatile unsigned int*'} to 'volatile uint8_t*' {aka 'volatile unsigned char*'} in assignment
202 | #define portInputRegister(port) (((port)==_PORT_GPIO16)?((volatile uint32_t*) &GP16I):((volatile uint32_t*) &GPI))
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| volatile uint32_t* {aka volatile unsigned int*}
C:\Users\Martin\Documents\Arduino\libraries\HCMP3\HCMP3.cpp:48:12: note: in expansion of macro 'portInputRegister'
48 | _rxPort = portInputRegister(digitalPinToPort(rxPin));
| ^~~~~~~~~~~~~~~~~
exit status 1
Error compiling for board Generic ESP8266 Module.

Have you any ideas if there's a way to make this library / sketch work with ESPs ?

Thanks and regards
Martin / Megabyte

Re: HCMODU0138 Serial MP3 player and ESP

Posted: Wed Jan 04, 2023 9:57 am
by andrew
Attached is V1.1 of the library which should hopefully fix the problem. I'm not able to test it right now but if you could give it a try and let me know if it worked and I can then add it to the software section of the forum.


HCMP3_V1_1.zip

Re: HCMODU0138 Serial MP3 player and ESP

Posted: Tue Jan 10, 2023 12:54 pm
by grahameL
I've just tried this updated Version with an Adafruit Feather 32 and it works perfectly. I too couldn't get this to compile on an ESP32 with the earlier version (1). Thanks for the new version.

Re: HCMODU0138 Serial MP3 player and ESP

Posted: Wed Jan 11, 2023 8:55 am
by andrew
Thanks for confirming, I'll get this new version added to the software section shortly.