Radio library Bluepill

Can someone help me port this library?
iscle
Posts: 7
Joined: Thu Apr 27, 2017 11:06 am
Location: Barcelona

Radio library Bluepill

Post by iscle » Wed Jul 12, 2017 1:51 pm

Hi,

i've been trying to get a TEA5767 working with the STM32 arduino port with the Radio library which can be found on GitHub, but i get lots of warnings and errors when trying to compile the Test sketch for the STM32 board. If I try to compile it for an arduino uno or an arduino nano it works just fine!

What should I do?

This is the error

Code: Select all

In file included from C:\Users\Iscle\Documents\Arduino\libraries\Radio-master\examples\TestTEA5767\TestTEA5767.ino:36:0:

C:\Users\Iscle\Documents\Arduino\libraries\Radio-master\src/radio.h:124:1: warning: 'typedef' was ignored in this declaration [enabled by default]

 };

 ^

C:\Users\Iscle\Documents\Arduino\libraries\Radio-master\src/radio.h:133:1: warning: 'typedef' was ignored in this declaration [enabled by default]

 };

 ^

In file included from C:\Users\Iscle\Documents\Arduino\libraries\Radio-master\src\RDA5807M.cpp:21:0:

C:\Users\Iscle\Documents\Arduino\libraries\Radio-master\src/radio.h:124:1: warning: 'typedef' was ignored in this declaration [enabled by default]

 };

 ^

C:\Users\Iscle\Documents\Arduino\libraries\Radio-master\src/radio.h:133:1: warning: 'typedef' was ignored in this declaration [enabled by default]

 };

 ^

C:\Users\Iscle\Documents\Arduino\libraries\Radio-master\src\RDA5807M.cpp: In member function 'virtual void RDA5807M::checkRDS()':

C:\Users\Iscle\Documents\Arduino\libraries\Radio-master\src\RDA5807M.cpp:381:38: error: no matching function for call to 'TwoWire::requestFrom(int, int, int)'

       Wire.requestFrom(I2C_INDX, 8, 1);                  // Retransmit device address with READ, followed by 8 bytes

                                      ^

C:\Users\Iscle\Documents\Arduino\libraries\Radio-master\src\RDA5807M.cpp:381:38: note: candidates are:

In file included from C:\Users\Iscle\Documents\Arduino\hardware\Arduino_STM32-master\STM32F1\libraries\Wire/Wire.h:43:0,

                 from C:\Users\Iscle\Documents\Arduino\libraries\Radio-master\src\RDA5807M.cpp:19:

C:\Users\Iscle\Documents\Arduino\hardware\Arduino_STM32-master\STM32F1\libraries\Wire/WireBase.h:101:11: note: uint8 WireBase::requestFrom(uint8, int)

     uint8 requestFrom(uint8, int);

           ^

C:\Users\Iscle\Documents\Arduino\hardware\Arduino_STM32-master\STM32F1\libraries\Wire/WireBase.h:101:11: note:   candidate expects 2 arguments, 3 provided

C:\Users\Iscle\Documents\Arduino\hardware\Arduino_STM32-master\STM32F1\libraries\Wire/WireBase.h:106:11: note: uint8 WireBase::requestFrom(int, int)

     uint8 requestFrom(int, int);

           ^

C:\Users\Iscle\Documents\Arduino\hardware\Arduino_STM32-master\STM32F1\libraries\Wire/WireBase.h:106:11: note:   candidate expects 2 arguments, 3 provided

C:\Users\Iscle\Documents\Arduino\libraries\Radio-master\src\RDA5807M.cpp: In member function 'virtual void RDA5807M::debugStatus()':

C:\Users\Iscle\Documents\Arduino\libraries\Radio-master\src\RDA5807M.cpp:483:33: error: no matching function for call to 'TwoWire::requestFrom(int, int, int)'

   Wire.requestFrom(I2C_INDX,32,1);                  // Retransmit device address with READ, followed by 8 bytes

                                 ^

C:\Users\Iscle\Documents\Arduino\libraries\Radio-master\src\RDA5807M.cpp:483:33: note: candidates are:

In file included from C:\Users\Iscle\Documents\Arduino\hardware\Arduino_STM32-master\STM32F1\libraries\Wire/Wire.h:43:0,

                 from C:\Users\Iscle\Documents\Arduino\libraries\Radio-master\src\RDA5807M.cpp:19:

C:\Users\Iscle\Documents\Arduino\hardware\Arduino_STM32-master\STM32F1\libraries\Wire/WireBase.h:101:11: note: uint8 WireBase::requestFrom(uint8, int)

     uint8 requestFrom(uint8, int);

           ^

C:\Users\Iscle\Documents\Arduino\hardware\Arduino_STM32-master\STM32F1\libraries\Wire/WireBase.h:101:11: note:   candidate expects 2 arguments, 3 provided

C:\Users\Iscle\Documents\Arduino\hardware\Arduino_STM32-master\STM32F1\libraries\Wire/WireBase.h:106:11: note: uint8 WireBase::requestFrom(int, int)

     uint8 requestFrom(int, int);

           ^

C:\Users\Iscle\Documents\Arduino\hardware\Arduino_STM32-master\STM32F1\libraries\Wire/WireBase.h:106:11: note:   candidate expects 2 arguments, 3 provided

exit status 1
Thanks a lot.

EDIT: The board is the Bluepill one.
Last edited by iscle on Wed Jul 12, 2017 10:15 pm, edited 1 time in total.

User avatar
Rick Kimball
Posts: 1071
Joined: Tue Apr 28, 2015 1:26 am
Location: Eastern NC, US
Contact:

Re: Radio library Bluepill

Post by Rick Kimball » Wed Jul 12, 2017 2:23 pm

-rick

stevestrong
Posts: 1970
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany
Contact:

Re: Radio library Bluepill

Post by stevestrong » Wed Jul 12, 2017 3:49 pm

Which STM32 board?

zmemw16
Posts: 1608
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: Radio library Bluepill

Post by zmemw16 » Wed Jul 12, 2017 4:10 pm

radio+library+TEA5767 --> 6 repo's cf 343 :)
+arduino and its 5
stephen

iscle
Posts: 7
Joined: Thu Apr 27, 2017 11:06 am
Location: Barcelona

Re: Radio library Bluepill

Post by iscle » Wed Jul 12, 2017 10:14 pm

Hi,

yup, i forgot to put the link to the library hahaha
It's this one: https://github.com/mathertel/Radio

The board is the BluePill one.

I've chosen this one because it seemed to work with arduino, but it can be any library as long as it works with the TEA5767, something I couldn't find.

Thanks!

bdbell
Posts: 20
Joined: Tue Apr 28, 2015 7:35 am

Re: Radio library Bluepill

Post by bdbell » Thu Jul 13, 2017 1:15 am

I have been using the attached library with STM32 and TEA Radio module.
Attachments
TEA5767Radio.zip
(2.51 KiB) Downloaded 22 times

iscle
Posts: 7
Joined: Thu Apr 27, 2017 11:06 am
Location: Barcelona

Re: Radio library Bluepill

Post by iscle » Tue Jul 18, 2017 9:28 pm

bdbell wrote:
Thu Jul 13, 2017 1:15 am
I have been using the attached library with STM32 and TEA Radio module.
Thanks! I will try it and see if it works for me. :)

iscle
Posts: 7
Joined: Thu Apr 27, 2017 11:06 am
Location: Barcelona

Re: Radio library Bluepill

Post by iscle » Sat Jul 22, 2017 10:17 pm

Okay, I've tried 3 libraries of which only 2 of them work, but the problem is that I can't seem to get past 103.5MHz frequency!!! If i go past that I can still hear that station, with a bit of noise... Anyone had this problem before?

Can it be a problem of having 10k pull up resistor on the i2c instead of 4k7?
Edit: I've tried with 5K resistors and it's still the same problem...

Thanks
Last edited by iscle on Sat Jul 22, 2017 10:27 pm, edited 1 time in total.

User avatar
RogerClark
Posts: 7549
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Radio library Bluepill

Post by RogerClark » Sat Jul 22, 2017 10:25 pm

iscle wrote:
Sat Jul 22, 2017 10:17 pm
Okay, I've tried 3 libraries of which only 2 of them work, but the problem is that I can't seem to get past 103.5MHz frequency!!! If i go past that I can still hear that station, with a bit of noise... Anyone had this problem before?

Can it be a problem of having 10k pull up resistor on the i2c instead of 4k7?

Thanks
Seems very unlikely this is a problem with Comms to the module.

Sounds like you reached the RF frequency limit if either the TX or the Rx

iscle
Posts: 7
Joined: Thu Apr 27, 2017 11:06 am
Location: Barcelona

Re: Radio library Bluepill

Post by iscle » Sat Jul 22, 2017 10:28 pm

RogerClark wrote:
Sat Jul 22, 2017 10:25 pm
iscle wrote:
Sat Jul 22, 2017 10:17 pm
Okay, I've tried 3 libraries of which only 2 of them work, but the problem is that I can't seem to get past 103.5MHz frequency!!! If i go past that I can still hear that station, with a bit of noise... Anyone had this problem before?

Can it be a problem of having 10k pull up resistor on the i2c instead of 4k7?

Thanks
Seems very unlikely this is a problem with Comms to the module.

Sounds like you reached the RF frequency limit if either the TX or the Rx
Hi Roger,
Thanks for answering...

I've tried with 5k pull ups and it's still the same problem.
Could it be due to a faulty chip? I've searched this problem and nobody seems to be having it! Strange... All stations from 103.5 and below work just fine...

Edit:
The library uses this to convert the frequency entered in (xxx.x) ex.(104.2) style and send it via i2c.

Code: Select all

void TEA5767Radio::setFrequency(float frequency)
{
  	unsigned int frequencyB = 4 * (frequency * 1000000 + 225000) / 32768; 
	byte frequencyH = frequencyB >> 8;
	byte frequencyL = frequencyB & 0XFF;
	HWire.beginTransmission(_address); 
	HWire.write(frequencyH);
	HWire.write(frequencyL);
	HWire.write(0xB0);
	HWire.write(0x10);
	HWire.write(0x00);
	HWire.endTransmission();
	delay(100);  
}

Post Reply