Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - bhabrooo

Pages: [1]
1
RFduino Libraries / AES Library not woking with RFduino RFD22301
« on: May 05, 2016, 05:07:17 AM »
Hello people,
                     alright so after completing my project i wanted to make the communication between my RFduino and the android application secure. Hence the natural option is AES encoding in particular 256 bit encoding. i opted to used the AESLib from the following GitHub repositry:
https://github.com/DavyLandman/AESLib

now the code compiles just fine normal
but as soon the line #include <AESLib.h> is added on top the RFduino compiler doesn't compile anymore.
the following is error generated:

Code: [Select]
Warning: platform.txt from core 'RFduino Boards' contains deprecated recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mcpu={build.mcu} {build.extra_flags} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" -Wl,--cref -o "{build.path}/{build.project_name}.elf" "-L{build.path}" -Wl,--warn-common -Wl,--warn-section-align -Wl,--start-group "{build.path}/syscalls.c.o" {object_files} "{build.variant.path}/{build.variant_system_lib}" "{build.variant.path}/libRFduino.a" "{build.variant.path}/libRFduinoBLE.a" "{build.variant.path}/libRFduinoGZLL.a" "{build.path}/{archive_file}" -Wl,--end-group, automatically converted to recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mcpu={build.mcu} {build.extra_flags} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" -Wl,--cref -o "{build.path}/{build.project_name}.elf" "-L{build.path}" -Wl,--warn-common -Wl,--warn-section-align -Wl,--start-group "{build.path}/core/syscalls.c.o" {object_files} "{build.variant.path}/{build.variant_system_lib}" "{build.variant.path}/libRFduino.a" "{build.variant.path}/libRFduinoBLE.a" "{build.variant.path}/libRFduinoGZLL.a" "{build.path}/{archive_file}" -Wl,--end-group. Consider upgrading this core.


Warning: platform.txt from core 'RFduino Boards' contains deprecated recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} "{build.path}/{archive_file}" "{object_file}", automatically converted to recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} "{archive_file_path}" "{object_file}". Consider upgrading this core.
recipe.S.o.pattern pattern is missing

Error compiling.


Sooooo if someone could help me out with this i'd be grateful.. btw please dont say make your own encryption method (i know i can) but i'd prefer to use a tested and tried method ^_^

--
Peace out!

p.s ignore the typos if any .. too lazy to correct them  :P

2
Getting Started / Re: Timer Interrupts
« on: May 06, 2015, 02:34:22 AM »
Thanks for this example of how to use a nordic timer.  I was curious what timers are used for PWM signals?  If I have an application that uses I2C, BTLE, and PWM do I still have a timer available for my own needs - like changing the PWM output on a pin?



Well the thing is whether you a timer available or not depends on the code you've implemented!
If you're using a timer solely for PWM then NO you don't have any timers left for use.
However what you could do is that use the timer which is being used in PWM to do some other task also .... i.e make an ISR (interrupt service routine)  that not only generates your required PWM control signal but performs tasks in parallel (not really parallel though)

ALternatively, you could Stop the i2c protocol after you've read your data from the device e.g accelerometer and use that timer for another purpose and keep switching back and forth.

lastly, (i don't recommend this if time precision is required) use a new count variable that updates periodically and use that (make your own timer)
Just be careful that whatever code is written in the ISR executes completely before the next interrupt is thrown otherwise you'd overload the stack as in:

uncompleted task1--->interrupt--->uncompleted task2--->interrupt--->uncompleted task3 ...... ad infinitum :/

3
Getting Started / Re: Timer Interrupts
« on: December 11, 2014, 05:00:04 AM »
Well here's the basic info i know:
we have 3 timers
Timer 0                     (used by BLE stack) so not usable if you want use Bluetooth!
Timer 1
Timer 2
If you are using serial communication e.g i2c then another timer will be used up for it so you'll only have one timer available!
Another point to note is that Timer1 and Timer2 work only in 16 bit mode even if you try to change them
Timer0 can operate in 32 bit mode

Here's a working example code i made  in which timer2 is used to generate a square wave.
It pretty similar to one the codes above but this one is simplified
Code: [Select]
#include <RFduinoBLE.h>
#define out 1

int output = 1;


void timer(unsigned int ms)                                 // directly pass the value you want the cycle to be in mS
{
  NRF_TIMER2->TASKS_STOP = 1;                                    // Stop timer
  NRF_TIMER2->MODE = TIMER_MODE_MODE_Timer;                        // sets the timer to TIME mode (doesn't make sense but OK!)
  NRF_TIMER2->BITMODE = TIMER_BITMODE_BITMODE_16Bit;               // with BLE only Timer 1 and Timer 2 and that too only in 16bit mode
  NRF_TIMER2->PRESCALER = 9;                                    // Prescaler 9 produces 31250 Hz timer frequency => t = 1/f =>  32 uS
                                                                   // The figure 31250 Hz is generated by the formula (16M) / (2^n)
                                                                   // where n is the prescaler value
                                                                   // hence (16M)/(2^9)=31250
  NRF_TIMER2->TASKS_CLEAR = 1;                                     // Clear timer
 
  //-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  //        Conversion to make cycle calculation easy
  //        Since the cycle is 32 uS hence to generate cycles in mS we need 1000 uS
  //        1000/32 = 31.25  Hence we need a multiplication factor of 31.25 to the required cycle time to achive it
  //        e.g to get a delay of 10 mS      we would do
  //        NRF_TIMER2->CC[0] = (10*31)+(10/4);
  //-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 
  NRF_TIMER2->CC[0] = (ms * 31) + (ms / 4);                                                                                  //CC[0] register holds interval count value i.e your desired cycle
  NRF_TIMER2->INTENSET = TIMER_INTENSET_COMPARE0_Enabled << TIMER_INTENSET_COMPARE0_Pos;                                     // Enable COMAPRE0 Interrupt
  NRF_TIMER2->SHORTS = (TIMER_SHORTS_COMPARE0_CLEAR_Enabled << TIMER_SHORTS_COMPARE0_CLEAR_Pos);                             // Count then Complete mode enabled
  attachInterrupt(TIMER2_IRQn, TIMER2_Interrupt);                                                                            // also used in variant.cpp in the RFduino2.2 folder to configure the RTC1
  NRF_TIMER2->TASKS_START = 1;                                                                                              // Start TIMER
}

void setup()
{
  RFduinoBLE.begin();
  timer(10);                                                 //configure the whole process with 10 ms interval this will generate sqaure wave with period 20 mS and freq 50 Hz
 
  pinMode(out, OUTPUT);

}

void loop()
{

}

// generate the square wave
void TIMER2_Interrupt(void)
{
  if (NRF_TIMER2->EVENTS_COMPARE[0] != 0)
  {
    output = !output;
    digitalWrite(out, output);
    NRF_TIMER2->EVENTS_COMPARE[0] = 0;
  }
}



The timer_config() cofucntion generates the timer sequences for the desired value passed to it in mS e.g
timer_config(1)          Generates a cycle of of 1mS and throws an interrupt when count is  over
timer_config(5)          Generates a cycle of of 1mS and throws an interrupt when count is  over

Hence TIMER2_Interrupt () which is an Interrupt service routine (ISR) generates high for one cycle and low for the next one.
i've pretty much mentioned what every lines means/ does so there should be no problem now i guess :)



Pages: [1]
anything