B4J Question Rpi3 and std:bad_alloc

micro

Well-Known Member
Licensed User
Longtime User
Hi to all
with Rpi2 and the same programs all work fine but with new board Rpi3 crash the program in this
line:
B4X:
If streamser.IsInitialized = False Then streamser.Initialize(jser.GetInputStream, Null, "streamser")
The object streamser is AsyncStreams

This is the log
B4X:
Program started.
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc

If i comment the line code, it's work.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
I did test jSerial and RPi 3 a few days ago and it worked properly (https://www.b4x.com/android/forum/threads/arduino-raspberry-pi.65820/).

What is the date and size of your jssc.jar ?

It should be:

SS-2016-04-19_08.50.51.png
 
Upvote 0

micro

Well-Known Member
Licensed User
Longtime User
What is the date and size of your jssc.jar ?

this line
B4X:
If streamser.IsInitialized = False Then streamser.Initialize(jser.GetInputStream, Null, "streamser")
is only the initialization the streamer after the open and settings com, without sending any data.

The project is UI, but i repeat if i remove (comment) this line work properly.
The project data is 5432 kb (on disk)

Thanks
 
Upvote 0

micro

Well-Known Member
Licensed User
Longtime User
Found the error:
With Raspi2 the first com in ListPorts is ttyS0 while in Raspi3 is ttyAMA0.
ttyAMA0 generates the exception.
 
Upvote 0
Top