Skip to content

Instantly share code, notes, and snippets.

/bin/bash #This script help us to see #This script help us to see availbe client in this sub-net
nmap -sP 192.168.100.0/24 | grep 192.168.*
@fboris
fboris / sd_backup
Created April 1, 2014 07:16
backup sd to single image file
#!/bin/bash
sudo dd if=/dev/sdb of=odroid.img bs=1M
A debugging session is active.
Inferior 1 [Remote target] will be detached.
Quit anyway? (y or n) Detaching from program: /home/fboris/quadrotor_workspace/moon-bear/shengwen_firmware/program/firmware.elf, Remote target
Remote debugging using /dev/ttyACM0
Target voltage: unknown
Available Targets:
No. Att Driver
1 STM32F4xx
Attaching to program: /home/fboris/quadrotor_workspace/moon-bear/shengwen_firmware/program/firmware.elf, Remote target
0x08010a32 in __ieee754_sqrtf ()
A debugging session is active.
Inferior 1 [Remote target] will be detached.
Quit anyway? (y or n) Detaching from program: /home/fboris/quadrotor_workspace/moon-bear/shengwen_firmware/program/firmware.elf, Remote target
Remote debugging using /dev/ttyACM0
Target voltage: unknown
Available Targets:
@fboris
fboris / Geometry Note
Last active August 29, 2015 14:07
Geometry Notes
##Use Euler angle to represent direction cosine matrix
$C_b^n = \left[
\begin{array}{clcr}
cos\theta cos\psi & -cos\phi sin\psi+sin\phi sin\theta cos\psi & sin\phi sin\psi + cos\phi sin\theta cos\psi\\
cos\theta sin\psi & cos\phi cos\psi+sin\phi sin\theta cos\psi & -sin\phi cos\psi + cos\phi sin\theta sin\psi\\
-sin\theta & sin\phi cos\theta & cos\phi cos\theta
\end{array}
\right]$
```
@fboris
fboris / USART_Init
Created October 11, 2013 09:05
USART Init Structure definition
/**
* @brief USART Init Structure definition
*/
typedef struct
{
uint32_t USART_BaudRate; /*!< This member configures the USART communication baud rate.
The baud rate is computed using the following formula:
- IntegerDivider = ((PCLKx) / (16 * (USART_InitStruct->USART_BaudRate)))
- FractionalDivider = ((IntegerDivider - ((u32) IntegerDivider)) * 16) + 0.5 */
void EXTI9_5_IRQHandler(void)
{
long lHigherPriorityTaskWoken = pdFALSE;
/* Only line 6 is enabled, so there is no need to test which line generated
the interrupt. */
EXTI_ClearITPendingBit( EXTI_Line6 );
/* This interrupt does nothing more than demonstrate how to synchronise a
task with an interrupt. First the handler releases a semaphore.
# openocd setup
source [find interface/jlink.cfg]
transport select swd
source [find target/stm32f1x.cfg]
# write image and restart target
proc program () {
init
@fboris
fboris / Makefile
Created June 18, 2019 13:51
nordic makefile
PROJECT_NAME := ble_app_uart_s130_pca10028
export OUTPUT_FILENAME
#MAKEFILE_NAME := $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
MAKEFILE_NAME := $(MAKEFILE_LIST)
MAKEFILE_DIR := $(dir $(MAKEFILE_NAME) )
TEMPLATE_PATH = ../../../../../../components/toolchain/gcc
ifeq ($(OS),Windows_NT)
include $(TEMPLATE_PATH)/Makefile.windows
@fboris
fboris / stm_native_bootloader.md
Last active September 27, 2023 09:23
dfu-util command for uploading firmware on ST devices
  1. Let device to enter dfu-mode. And use dfu-util to get available devices

sudo dfu-util -l

It will show like...

Found DFU: [0483:df11] ver=2100, devnum=32, cfg=1, intf=0, alt=3, name="@Device Feature/0xFFFF0000/01*004 g", serial="3262355B3231"
Found DFU: [0483:df11] ver=2100, devnum=32, cfg=1, intf=0, alt=2, name="@OTP Memory /0x1FFF7800/01*512 g,01*016 g", serial="3262355B3231"
Found DFU: [0483:df11] ver=2100, devnum=32, cfg=1, intf=0, alt=1, name="@Option Bytes  /0x1FFFC000/01*016 g", serial="3262355B3231"