This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Lost in 52832 land.

SALSProbe.inoSALSProbe.zip

I have attached an Arduino INO file that I wrote early on in a project.  It runs a probe.  It is an amazingly simple probe but especially important.  I am making a simple opacity sensor for blind chemistry students.  It has a glass tube with a resistor at the end.   It used to have a RedBear with an NRF52 chip   inside the handle with a battery.  The data was sent to an IOS app and blind students could store their received data in the app.  We were getting close to releasing the probe because it is not an extremely accurate device it is just for blind students to tell if the liquid is getting lighter or darker.      I was happy to be able to make it with Arduino because as you will see from the INO file I have attached It was not hard to make.  I will mention at this point that I am also 100% blind and have been working as a Software Engineer and project lead for quite a while. 

 

If you get my SALSProbe.zip file that I have attached you will see I have started remaking the INO to fit the nrf52832 chip because I had to have our engineers design me a replacement board since the RedBear is no longer made thus the support is gone for the Arduino IDE.  I have seen Arduino support for the NRF 52832, but I have not been able to get my board to work with the IDE>

 

So, I have downloaded the NRF SDK version 16.  I have also gone through many tutorials and have started down the path to making the INO file I have attached into a nrf52832 project with the rfx ski.  I am running into problems because many of the samples of how to do things I want to do are made for older SDK’s  This attached version is just my 4th attempt at starting and I am already running into trouble. 

 

I am running into accessibility issues.  For example, the new J-link tools are not accessible with my screen reader, so I am finding it hard to read the log information.  This causes problems because I cannot find out what ram values, I need to set to get my custom characteristic working.  Not to mention I am adding the battery service and still need to add the info service I used to have.  So that ram value will change a few more times.

 

 

Note I do know there is an NRF ble uart service but because the IOS app was already written to use the method the old Arduino libraries used I do not want to have to change the IOS app.  So, I am trying to create my own characteristic like in the old INO file.

 

I am failing terribly.  I only sent my embarrassing code in SALSProbe to show I am trying.  I am not asking without doing first.

 

Where I am now.  I have a start.  I have added a custom service with one characteristic.  I must change it to send 5 bytes though and I also need to make sure the battery service is working.  I still need to add the info service and I need to add the code where it will read from p0.04 which is a bit confusing to me.    I have tried reading the ad value but everything I have read is for older NRF and my code fails.  That code is not in this zip file but I could dig it up if after seeing this mess you think it will help.

I know I must use SADC sample but the more services I add the les my code runs. There is something wrong with my current code because it is not advertising its name or the characteristic.  It was showing the name at least before I added the custom characteristic. 

 

I think that is because I can’t see the log warnings telling me to expand the ram in the config.  If I could see it, I would set it in the config file.  If anyone has a way to log the chip logs to the command line rather than to the not accessible J-link viewer please let me know

 

.  I have also tried to use the rfx connect tools on my iPod and Android devices, but they are just barely accessible, and I have not been able to see the log files there either.  That could be a setup issue, or it could be the apps are just not accessible.

 

So here is my question after all that.   Is there someone out there that can help me or is there someone out there that can quickly convert my INO file to work on the NRF 52832 chip using the NRF 16 SDK?

I know if I were still sighted, I could pop up the Secure IDE and figure this out but as it is, I am failing, and I have been working on this for weeks.     If you think you can do it and do not want to do it for free.  I am desperate and we might be able to work something out.    I would like to get this built and out to the blind kids for when school starts up in September. 

 

Any help is greatly appreciated.

 

Sometimes I think it would be easier to go back to using Assembler.  When I coded in Assembler I didn’t have all this unaccessible GUI stuff.

 

Anyway if you have got this far thanks and again thanks for any help.

 

 

  • For example, the new J-link tools are not accessible with my screen reader

    There are command line versions of these SEGGER programs, e.g. using JLinkGDBServerCL.exe should get rid of those unreadable UI elements.

    I think that is because I can’t see the log warnings telling me to expand the ram in the config.

    Use the above JLinkGDBServerCL to flash and run your program (with arm-none-eabi-gdb, target is localhost:2331). Then connect to the RTT port via telnet client, host is "localhost" and port is 19021 (telnet localhost 19021).

    Both nordic command line tools and SEGGER are available for Linux, this might be simpler to setup with reader or Braille display.

    There is unfortunaltely no quick way for converting your .ino into an SDK program (that I know of). And no, you don't want to program an ARM Cortex-M in Assembler. These are meant to be programmed in C.

  • Ok.  I went out and read a page on the jlink server gdb.  I am used to the command line gdb which I use for a C++ server game project Irun in linux.      I have also ran the jdb server for a JAVA project I work on.  I ran into a slight snag here though.  

    I am compiling at the command line with make.  It is attached to the original question.  It looks like they did not make a default debug target in the Makefile of the SDK project I used as a base line.  I figure if I was using an IDE it would probably add it but I am not.  When doing regular C projects I just add -g to a target and use that.  I am a bit confused as to how I would add it to this make file.  It is using ooptimisation and -g3 which I will ahve to go read on.  If you know how to make a debug .elf using the Makefile in my project that would help.  

  • First I want to thank you because I forgot to in my last reply.  Thanks for the command line debugger.  I had not seen that one.   I still have not got it to work yet for either the logs or GDB.  I think if I can get the debugger working the logs will work.  Here is what I ahve tried

    I have got the jlinkgdbservercl working with:

    jlinkgdbserver -device nrf52832_xxaa -if swd -port 2331

    I usd telnet with the port you posted.  All seems to connect correctly.  Other than the connection messages I get nothing else.

    I Then try to compile my program with debugging 

    I changed the opt line from -O3 -g to

    -O0 -ggdb

    I also tried just g alone but I found -ggdb as an option on one of the documents I was reading on line.  Neither of them seem to create a .elf file and the hex file it does produce does not have debugging symbols at least when I do

    arm-none-eabi-gdb SALSProbe.hex

    It says there are none.  Everything I read says it should make an elf file but it doesn't.  Can you or anyone tell me what my possible problem is?  My Makefile is in the original zip file of the question and all I changed was the opt lines.  Is there something else I need to change?

    ken

  • The standard output from gcc is an .out file that is actually an ELF file. Try debugging the .out file.

  • Thanks that actually did it.  I have it running and can step into main.    I am still a long way from being done but at least I am moving again.  Is it still true that you can't debug with softdevice?  I saw something about having to break before any soft device function and then jump it and break after with a flag called PRIMASK?

    At least I know my software is running.  Now to start trying to figure out where it is dieing and why.

    Thanks to both of you that answerd.  I still think I should have paid a 14 year old to do this.  I might be getting to old *GRIN*.

Related