HCMODU0138 Serial MP3 player and ESP

Forum for posting topics and questions about anything.
Post Reply
Megabyte
Posts: 1
Joined: Thu Dec 29, 2022 7:07 pm

HCMODU0138 Serial MP3 player and ESP

Post by Megabyte » Fri Dec 30, 2022 8:42 am

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

andrew
Site Admin
Posts: 1301
Joined: Sun Aug 05, 2012 4:15 pm

Re: HCMODU0138 Serial MP3 player and ESP

Post by andrew » Wed Jan 04, 2023 9:57 am

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
You do not have the required permissions to view the files attached to this post.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

grahameL
Posts: 1
Joined: Tue Jan 10, 2023 11:22 am

Re: HCMODU0138 Serial MP3 player and ESP

Post by grahameL » Tue Jan 10, 2023 12:54 pm

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.

andrew
Site Admin
Posts: 1301
Joined: Sun Aug 05, 2012 4:15 pm

Re: HCMODU0138 Serial MP3 player and ESP

Post by andrew » Wed Jan 11, 2023 8:55 am

Thanks for confirming, I'll get this new version added to the software section shortly.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

Post Reply

Return to “General Discussion”