Question about setting up BLE nordic nRf8001

Redbox · 6 · 3154

Redbox

  • Newbie
  • *
    • Posts: 2
    • View Profile
Hi everyone,

I was hoping to get a little help with setting up my Bluetooth Low Energy (nRF8001), I can run the "sample" code directly from codebreaker but
if I download the code and follow the instructions:

-----------------------------------------------------------------------------------------------------------------------------------
//when using this project in the Arduino IDE, delete the following include and rename UART.h to UART.ino
-----------------------------------------------------------------------------------------------------------------------------------



Which I hope that I am interrupting correctly to be remove the line of code #include UART.h and actually rename the file UART.ino

When I do this, I get an error that says:

-----------------------------------------------------------------------------------------------------------------------
Arduino: 1.6.8 (Windows 8.1), Board: "Arduino Pro or Pro Mini, ATmega328 (3.3V, 8 MHz)"

Build options changed, rebuilding all
C:\Users\Home\AppData\Local\Temp\arduino_modified_sketch_528889\UART.ino:206:6: warning: unused parameter 'length' [-Wunused-parameter]

 bool uart_process_control_point_rx(uint8_t *byte, uint8_t length)

      ^

C:\Users\Home\AppData\Local\Temp\arduino_modified_sketch_528889\UART.ino: In function 'void aci_loop()':

C:\Users\Home\AppData\Local\Temp\arduino_modified_sketch_528889\UART.ino:298:15: warning: enumeration value 'ACI_DEVICE_INVALID' not handled in switch [-Wswitch]

         switch(aci_evt->params.device_started.device_mode)

               ^

C:\Users\Home\AppData\Local\Temp\arduino_modified_sketch_528889\UART.ino:298:15: warning: enumeration value 'ACI_DEVICE_TEST' not handled in switch [-Wswitch]

C:\Users\Home\AppData\Local\Temp\arduino_modified_sketch_528889\UART.ino:298:15: warning: enumeration value 'ACI_DEVICE_SLEEP' not handled in switch [-Wswitch]

C:\Users\Home\AppData\Local\Temp\arduino_modified_sketch_528889\UART.ino:290:11: warning: enumeration value 'ACI_EVT_INVALID' not handled in switch [-Wswitch]

     switch(aci_evt->evt_opcode)

           ^

C:\Users\Home\AppData\Local\Temp\arduino_modified_sketch_528889\UART.ino:290:11: warning: enumeration value 'ACI_EVT_ECHO' not handled in switch [-Wswitch]

C:\Users\Home\AppData\Local\Temp\arduino_modified_sketch_528889\UART.ino:290:11: warning: enumeration value 'ACI_EVT_BOND_STATUS' not handled in switch [-Wswitch]

C:\Users\Home\AppData\Local\Temp\arduino_modified_sketch_528889\UART.ino:290:11: warning: enumeration value 'ACI_EVT_DATA_ACK' not handled in switch [-Wswitch]

C:\Users\Home\AppData\Local\Temp\arduino_modified_sketch_528889\UART.ino:290:11: warning: enumeration value 'ACI_EVT_DISPLAY_PASSKEY' not handled in switch [-Wswitch]

C:\Users\Home\AppData\Local\Temp\arduino_modified_sketch_528889\UART.ino:290:11: warning: enumeration value 'ACI_EVT_KEY_REQUEST' not handled in switch [-Wswitch]

C:\Users\Home\AppData\Local\Temp\arduino_modified_sketch_528889\UART.ino: At global scope:

UART:78: error: setup_msgs causes a section type conflict with __c

 static hal_aci_data_t setup_msgs[NB_SETUP_MESSAGES] PROGMEM = SETUP_MESSAGES_CONTENT;

                       ^

In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28:0,

                 from sketch\TinyShield_NRF8001_BLE_Example.ino.cpp:1:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/WString.h:38:74: note: '__c' was declared here

 #define F(string_literal) (reinterpret_cast<const __FlashStringHelper *>(PSTR(string_literal)))

                                                                          ^

C:\Users\Home\AppData\Local\Temp\arduino_modified_sketch_528889\UART.ino:444:37: note: in expansion of macro 'F'

         if(BLE_DEBUG)Serial.println(F("Advertising started"));

                                     ^

exit status 1
setup_msgs causes a section type conflict with __c

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

----------------------------------------------------------------------------------------------------------------------





Which stops me from uploading it and trying to configure the code to do something.

On that note:

Even if I run the code from codebreaker, I get an error unless I have the serial monitor open.

How do I configure it just to see the data on my phone only and not need a serial monitor?



This is my first attempt at using the Tinyduino, and what I am trying to make is a bluetooth connected light sensor. Which I have done on a regular Arduino Uno.

But my attempt to get it to work on the Tinyduino has failed thus far. I suspect it may have to do with the differences in the Bluetooth that I am using. (Its my first attempt at using Bluetooth on anything)

Any help in this matter would be great.

Thanks!


Ben Rose

  • Administrator
  • Hero Member
  • *****
    • Posts: 357
    • View Profile
Yes, that's the intent of the commented instruction. I just got a chance to test this with 1.6.8- first, what error are you getting with codebender without the serial monitor open? I'm running https://codebender.cc/sketch:91073 and don't notice one.

I also don't see the same errors in the IDE. I get the 'usual' error with the hal_aci_data_t type due to differences in how codebender and the IDE compile the code.

I put a new workaround in place in the example to avoid this- try downloading the zip again and following the new instructions(#define CODEBENDER false, rename uart.h to uart.ino). This now works correctly in the IDE for me, so see what you get and we can try to figure out any other differences.

Thanks,
Ben


Redbox

  • Newbie
  • *
    • Posts: 2
    • View Profile
Thanks for the response.

The new code still gives me some error text, but it seems to upload just the same, and work with one of the apps I download.

Im kind of lost on how to setup the rest of my project with it though. As the code is somewhat robust. I will try to figure it out.

Thank you for the help.


memcbride

  • Newbie
  • *
    • Posts: 2
    • View Profile
Yes, that's the intent of the commented instruction. I just got a chance to test this with 1.6.8- first, what error are you getting with codebender without the serial monitor open? I'm running https://codebender.cc/sketch:91073 and don't notice one.

I also don't see the same errors in the IDE. I get the 'usual' error with the hal_aci_data_t type due to differences in how codebender and the IDE compile the code.

I put a new workaround in place in the example to avoid this- try downloading the zip again and following the new instructions(#define CODEBENDER false, rename uart.h to uart.ino). This now works correctly in the IDE for me, so see what you get and we can try to figure out any other differences.

Thanks,
Ben

I downloaded the TinyShield_NRF8001_BLE_Example this evening and am using Arduino 1.6.8 on a Mac.  I changed line 4 in the main code file to #define CODEBENDER false  and renamed the UART.h file to UART.ino

I am getting compile fails in the aci.h file of the form

aci.h:265: error: 'uint16_t' does not name a type

I have the nordic board connected to the TinyScreen+ board.

I'm not sure why I would get a compile error on the uint16_t type.  I've used it in other sketches.

Any ideas/suggestions are appreciated.

Mark


Ben Rose

  • Administrator
  • Hero Member
  • *****
    • Posts: 357
    • View Profile
Hi Mark- there are some changes needed for TS+ that we should have gotten out earlier, sorry about that. I've added them to https://codebender.cc/sketch:91073 , can you download that and give it a try? It builds on my system, Win7/1.6.8

As you say, uint16_t should be fine- probably 'dumb' compiler output.

Thanks,
Ben


memcbride

  • Newbie
  • *
    • Posts: 2
    • View Profile
Hi Mark- there are some changes needed for TS+ that we should have gotten out earlier, sorry about that. I've added them to https://codebender.cc/sketch:91073 , can you download that and give it a try? It builds on my system, Win7/1.6.8

As you say, uint16_t should be fine- probably 'dumb' compiler output.

Thanks,
Ben

Thank you Ben.  Successful compile with no errors on Mac OS 10.11.4 with Arduino IDE 1.6.9.  Now onto sorting out how to do something  :)

Best regards,

Mark


 

SMF spam blocked by CleanTalk