Hello
im using using FX30S wp77xx module with R11 + Legato 18.09.2 and we are migrating to R14.1.1 due to the recent sierra comunication about the new memory module which will not be supported by old firmwares.
Moved from devstudio to vscode+leaf dev env
Using leaf package swi-wp77_5.0.2
I have built the system with no errors , used swicwe to build a complete spk including linux+modem+legato and then flashed it onto the device.
The flash was successfull but for some reason one application using the GPIO to power the usr led has trouble binding the the gpioService.
After some debug , doing the command “sdir list” from ssh connection
i found out that the required platform service export for the GPIO pins were missing.
thinking it was a firmware build problem, i downloaded the full r14.1.1 release from sierra site and flashed the modem
doing sdir list now shows the pins 47 and 48 which are the usr led pins.
After this test i’ve rebuilt the my firmware again and flashed it onto the modem to see if maybe it was just a random case.
Still, with my build the GPIO pins 47 and 48 are not exported.
going deeper, checking the /sys/class/gpio directory on my firmware i see no gpioXX files
while with the r14.1.1 full from sierra i can see the gpioXX files.
Im aware of the GPIO_DESIGN_V2 and also checked in /sys/class/gpio/v2 folder, same result, on my firmware there are no files named gpioXX while on the sierra one there are.
in the sierra firmware doing a cat on the mask and mask_v2 file , which is used to determine if the pin is available or not under the folder /sys/class/gpio/gpiochip1 i get:
mask: 0x000003ffffbfff77
mask_v2 : 77 ff bf ff ff 03 00 00 00 00
the same result is given for my firmware
doing gpioSysfs_IsPinAvailable function my self with pen and paper i see that the pin 47 and 48 are under the “03” which should not made them available even in the sierra firmware.
because the result whill always be false when doing “check & (1 << bitInMask));”
all the pins will be available if all the hex codes are “f”
here the complete function code
bool gpioSysfs_IsPinAvailable
(
int pinNum ///< [IN] GPIO object reference
)
{
char path[64];
char result[33];
le_result_t leResult;
uint8_t check;
uint32_t index;
uint32_t bitInMask;
if ((pinNum < MIN_PIN_NUMBER) || (pinNum > MAX_PIN_NUMBER))
{
LE_WARN("Pin number %d is out of range", pinNum);
return false;
}
snprintf(path, sizeof(path), "%s/gpiochip1/mask%s",
SYSFS_GPIO_PATH, (GpioDesign == SYSFS_GPIO_DESIGN_V2 ? "_v2" : ""));
leResult = ReadSysGpioSignalAttr(path, sizeof(result), result);
if (leResult != LE_OK)
{
return false;
}
LE_DEBUG("Mask read as: %s", result);
if (GpioDesign == SYSFS_GPIO_DESIGN_V2)
{
bitInMask = (pinNum - 1) % 8;
index = ((pinNum - 1) / 8) * 3 + (bitInMask < 4);
bitInMask %= 4;
}
else
{
// The mask is 64 bits long
// The format of the string is 0xnnnnnnnnnnnnnnnn. Each "n" represents 4 pins, starting
// with pin 1-4 on the far right. So we can calculate where to look based on the pin number
// e.g. 1-4 = index 17, 5-8 = index 16 etc.
index = 17 - (pinNum - 1) / 4;
bitInMask = (pinNum - 1) % 4;
}
// Convert the mask to a number from a hex string
LE_DEBUG("Mask calculated for %d as bit %d at index %d", pinNum, bitInMask, index);
// Convert the entry in the mask from a hex character to a number
check = toupper(result[index]) - (isdigit(result[index]) ? '0' : 'A' - 10);
LE_DEBUG("About to compare %x and %x", check, (1 << bitInMask));
return (check & (1 << bitInMask));
}
i’ve rebuilt the firmware many times , but i am unable to make the pins 47 and 48 work and im out of ideas.
I moved also to the legato source doing leaf getsrc swi-legato and rebuilt the entire framework before building my system , but the problem still persist.
To build my spk file is use the linux and modem images downloaded by leaf.
i’ve also tried the r15 (which is present only on leaf and its still in beta) but the problem is the same , also i cant test r15 firmware built by sierra because there isn’t one on the sierra site.
Any suggestion? what am i missing when build my firmware? why does the sierra firmware works if the bit mask should not let the lagato function export the pins 47 and 48?