Closed stefanosky closed 4 years ago
Hi, You can see these examples. They are imported from nRF5 SDK. You can follow these steps to import a new one by yourself:
.
├── armgcc
│ ├── Makefile
│ ├── _build
│ └── ble_app_blinky_gcc_nrf52.ld
├── config
│ └── sdk_config.h
├── hex
│ └── ble_app_blinky_nrf52840_mdk_s140.hex
└── main.c
MDK_ROOT := ../../../..
SDK_ROOT := $(MDK_ROOT)/nrf_sdks/nRF5_SDK_15.2.0_9412b96
PROJ_DIR := ..
nrf52840_mdk.h
and custom_board.h
CFLAGS += -DBOARD_CUSTOM
CFLAGS += -DNRF52840_MDK
...
ASMFLAGS += -DBOARD_CUSTOM
ASMFLAGS += -DNRF52840_MDK
pyocd
command in Makefile:
.PHONY: flash flash_softdevice flash_all erase release
flash: default @echo Flashing: $(OUTPUT_DIRECTORY)/nrf52840_xxaa.hex pyocd-flashtool -t nrf52 -se $(OUTPUT_DIRECTORY)/nrf52840_xxaa.hex
flash_softdevice: @echo Flashing: s140_nrf52_6.1.0_softdevice.hex pyocd-flashtool -t nrf52 -se $(SDK_ROOT)/components/softdevice/s140/hex/s140_nrf52_6.1.0_softdevice.hex
flash_all: default mergehex -m $(OUTPUT_DIRECTORY)/nrf52840_xxaa.hex $(SDK_ROOT)/components/softdevice/s140/hex/s140_nrf52_6.1.0_softdevice.hex -o $(OUTPUT_DIRECTORY)/nrf52840_xxaa_s140.hex @echo Flashing: $(OUTPUT_DIRECTORY)/nrf52840_xxaa_s140.hex pyocd-flashtool -t nrf52 -se $(OUTPUT_DIRECTORY)/nrf52840_xxaa_s140.hex
erase: pyocd-flashtool -t nrf52 -ce
release: @echo Generating hex file... mergehex -m $(OUTPUT_DIRECTORY)/nrf52840_xxaa.hex $(SDK_ROOT)/components/softdevice/s140/hex/s140_nrf52_6.1.0_softdevice.hex -o $(PROJ_DIR)/hex/$(PROJECT_NAME).hex
6. If Log UART backend is used, remember to set `NRF_LOG_BACKEND_UART_TX_PIN` to `20` in `sdk_config.h`
That's it!
thank you very much for this usefull tut :) i will do it ok, i'had problem with logging, i tried to insert logging in blink example, with no success. so for logging it's only to put NRF_LOG_BACKEND_UART_TX_PIN 20 ? therarent other flags to activate?
thank you very much for this usefull tut :) i will do it ok, i'had problem with logging, i tried to insert logging in blink example, with no success. so for logging it's only to put NRF_LOG_BACKEND_UART_TX_PIN 20 ? therarent other flags to activate?
Just for the examples with logging module enabled. Also seeing this example and comparing with the blinky example, you will know how to enable a UART logging module.
yess!! thanks for the patience, you still help me very much, and i hope other people starting prototyping with your module.
here a blink with log that i wrote :)
`
"-- "BOARD_NAME " --"STRING_EOL \
"-- Compiled: "__DATE__ " "__TIME__ " --"STRING_EOL
static void log_init(void) { ret_code_t err_code = NRF_LOG_INIT(NULL); APP_ERROR_CHECK(err_code); NRF_LOG_DEFAULT_BACKENDS_INIT(); nrf_delay_ms(100); }
int main(void) { uint32_t conteggio=0;
log_init();
bsp_board_init(BSP_INIT_LEDS);
nrf_delay_ms(100);
NRF_LOG_INFO(STRING_HEADER);
NRF_LOG_INFO("blink startedddd");
nrf_delay_ms(100);
NRF_LOG_FLUSH();
/* Toggle LEDs. */
// Enter main loop.
while (true)
{
conteggio++;
NRF_LOG_INFO("c %d", conteggio);
NRF_LOG_FLUSH();
nrf_delay_ms(100);
for (int i = 0; i < LEDS_NUMBER; i++)
{
NRF_LOG_INFO("blink al led %d .", i );
NRF_LOG_FLUSH();
nrf_delay_ms(100);
bsp_board_led_invert(i);
nrf_delay_ms(1000);
}
}
} `
I’m closing this issue because it has been inactive for a long time. Please reopen if you still encounter this issue. Thank you!
please can you explain how to use the others sdk examples, from Nordic. like other example about nfc and ble. in particular the import section and the board specification
thanks