BatteryService & spiService crashing


#1

Hello,

I took the latest 18.9.0 VM and update mangoh code. Running 10.1 Legato firmware (WP76xx).

It appears that there are some changes happened to the above services.
When I run my application, these services are faulting with a crash (Battery Service) and an error on spiService.

Dec 5 12:49:33 swi-mdm9x28-wp user.info Legato: INFO | supervisor[843]/supervisor T=main | proc.c proc_SigChildHandler() 2064 | Process 'battery' (PID: 6694) has exited due to signal 8 (Floating point exception).

le_spi_Open failed with result=LE_NOT_FOUND

Are there any significant changes?

I had no issues with them on earlier version (18.7.0) .

Thanks
Madan


#2

Add:

With respect to Battery Service, some changes (API level) are obeserved and necessary updates were done on my code to compile without issues.


#3

After few hours of troubleshooting, it is observed that the updated Battery service model is trying to access configuration of battery [mAh, Voltage & Type] from dataHub service. If it is not already present, it is expected that mAh is initialized to -1. However, the initial values are 0 for mAh and it failing in a division operation. Updated to consider mAh=0 as an initial value and let the service’s state machine in STATE_UNCONFIGURED to let a client to initialize these values.

Client application also need to have some default initial values so that it doesn’t push zeros into dataHub.

And this patch made it execute as I expected.

spiservice is still not working.


#4

My bad on spiService.
We have a device connected to spi bus on RPi connector (accessed as spidev32766.1. Hence, the spiService is needed a small update for this device in .adef file. missed that one.

Anyways I have couple of things to mangOH team.

  1. Is there a plan to update Battery Service as per my comments?
  2. Is there a paln to update SPI service for all other known SPI interfaces on board?

Thanks