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.

 

 

Parents
  • 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.

  • 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

  • OK I do have another question.  I am using the SAADC example from the SDK peripheral section of examples.  I have compiled it for my Raytac MDBT42Q module which has an NRF52832 chip as its core.  I have read the PDF on the Raytac module and it has chip pin 17 attached to P0.04 AIN2.  

    I have changed the Saadc  to use AIN2.  I ran the code and watched the output in the log.

    I have a photo resistor attached between VIN of the board to the P0.04(AIN2)

    I expected to see values from 0 to 1024 because the resolution is set to 10 bit.  This is what I see on my original Arduino INO sketch.   

    I am not seeing values from 0-1024.  I am seing a few values ranging from -1 to -8. 

    Again I have changed nothing in the SAADC but the AIN2.  So my question is how do I get this to give me values I am expecting.  Is this some kind of big little indian problem or  what am I seeing in this buffer.

    Note if I change the AIN to values of other pins that I have nothing attached to.  The log shows me values like 16,18,17 in the buffers. 

    So I am a bit confused at what the samples are.  I have read as much as I can find on this and I am confused.

  • Have you sampled a known reference voltage and compared the output of the ADC?

  • Not as of yet.  I was supposed to get a couple of the Raytac dev boards but Amazon is playing silly buggers.  I will try to read the value straight off the battery on this current board we built.  That should be something that makes sense since the board is obviously working.  Thanks for the suggestion.  By the way.  I would like to click on what ever I need to to thank you guys for your answer but my screen reader is not telling me what I should click on.      I have buttons on this screen like up, down, verify what should I be clicking on so you guys get ranked.

  • A battery works great, do you have a multimeter to test the voltage of the battery first? 

    Don't worry about the voting system, it doesn't really work anyways xD

  • Yes I have a multi-meter and it is actually working when I test on VDD.  My dev boards are coming in the morning.  It looks like I have a problem with the connection to the probe.    I am going to give the board back to the engineer.   Once I get my Raytac board in the morning. I should be able to complete the code with all the information you guys have gave me.

    Thanks for all your help and I might be back if this doesn't just start working with the new Raytac board.

Reply
  • Yes I have a multi-meter and it is actually working when I test on VDD.  My dev boards are coming in the morning.  It looks like I have a problem with the connection to the probe.    I am going to give the board back to the engineer.   Once I get my Raytac board in the morning. I should be able to complete the code with all the information you guys have gave me.

    Thanks for all your help and I might be back if this doesn't just start working with the new Raytac board.

Children
No Data
Related