I've been attempting to get the ttyS0 to talk to a socketmodem on my Galileo GEN2 from a native C app. I built the mraa sample code for exposing the rx/tx pins which calls 0). It should return an instance of mraa_uart_context but instead I get a NULL.
I looked at the libmraa source and it's pretty clear that mraa_uart_init will return NULL in exactly 3 circumstances:
- advance_func->uart_init_pre fails
- advance_func->uart_init_post fails
- mraa_setup_uart fails.
Since intel_galileo_rev_g.c doesn't set up either advance_func->uart_init_pre or advance_func->uart_init_post they can be ruled out immediately because they never get called. That leaves mraa_setup_uart(int) as the culprit:
I think the first three sanity checks can be ignored as unlikely. I imagine the problem comes from one of the calls to mraa_setup_mux_mapped().
Since I assume that this works on some GEN2 boards what I really would like to know is why is my board different? I have other evidence to suggest that it is different like the fact that the Debian images built by @StuartAnderson and others fail in very hardware suspicious ways. Since the documentation is extremely incoherent on the subject of board revision, I would really love it if somebody would explain briefly how the revision naming scheme works in Galileo/Edison land. For instance, the MRAA lib documentation suggests that it only works on GEN2 boards that are "RevG". That suggests they there are other revisions of GEN2 boards. How do I determine that? I don't see it silkscreened on the PCB. Examing /sys on my boards I get:
cat /sys/devices/virtual/dmi/id/board_version: FAB-D
Does that mean GEN2 revD? Man I'm confused ...
I would super appreciate it if someone like Mathias or Brenddan or maybe Tom (or anybody who knows for sure) would give me a little insight here. If nobody has time to look at the problem I will be glad to debug the issue. Just need to know how to build the library with debug turned on. The github instructions for building the lib under the IODTK are for Edison.
This is a big issue for us. Thanks hugely in advance for any help,