Coder Social home page Coder Social logo

Comments (5)

RoganDawes avatar RoganDawes commented on June 30, 2024

I'm not entirely sure what you are trying to do, and what you have done so far that hasn't worked. Can you elaborate a bit, please?

from logitacker.

JohnHonai2255 avatar JohnHonai2255 commented on June 30, 2024

I was trying to change the Logitacker shell interface from USB to UART on the nrf dongle(PCA10059).
I tried to change the logitacker code by taking reference from the cli uart example from the nRF5 SDK

The changes I made to main.c so far :

#define TX_PIN_NUMBER NRF_GPIO_PIN_MAP(1,0)
#define RX_PIN_NUMBER NRF_GPIO_PIN_MAP(0, 9)

// NRF_CLI_CDC_ACM_DEF(m_cli_cdc_acm_transport);
// NRF_CLI_DEF(m_cli_cdc_acm, g_logitacker_cli_name, &m_cli_cdc_acm_transport.transport, '\r', 20);
NRF_CLI_UART_DEF(m_cli_uart_transport, 0, 64, 16);
NRF_CLI_DEF(m_cli_uart,
		g_logitacker_cli_name,
		&m_cli_uart_transport.transport,
		'\r',
		4);

// changes inside main.c
int main(void){
	// ret = nrf_cli_init(&m_cli_cdc_acm, NULL, true, true, NRF_LOG_SEVERITY_INFO);
	// APP_ERROR_CHECK(ret);
	nrf_drv_uart_config_t uart_config = NRF_DRV_UART_DEFAULT_CONFIG;
	uart_config.pseltxd = TX_PIN_NUMBER;
	uart_config.pselrxd = RX_PIN_NUMBER;
	uart_config.baudrate = 30801920;
	uart_config.hwfc    = NRF_UART_HWFC_DISABLED;
	nrf_cli_init(&m_cli_uart, &uart_config, true, true, NRF_LOG_SEVERITY_INFO);

	// nrf_cli_start(&m_cli_cdc_acm);
	ret = nrf_cli_start(&m_cli_uart);
	APP_ERROR_CHECK(ret);

	inside while(True){

		// nrf_cli_process(&m_cli_cdc_acm);
		nrf_cli_process(&m_cli_uart);
	}
}

from logitacker.

mame82 avatar mame82 commented on June 30, 2024

There shouldn't be a need to modify SDK headers (nrf_cli h), but you have to carefully craft the config files for your custom board, iot include required libs during compilation.

Also there might be a need to use two UARTs iot deconflict 'uart_cli' and 'uart_logging'

Look through my custom board configs for MakerDiary MDK, adjust settings as required and carefully match them to your board:

https://github.com/RoganDawes/LOGITacker/tree/master/mdk/blank/config

Sorry for not being more helpful, still lacking the time to support this

from logitacker.

RoganDawes avatar RoganDawes commented on June 30, 2024

From what I can see, MaMe82 used a Nordic library "mod_cli" to implement the command line interface. Looking through the files, there is a mod_cli/ directory, with files for Bluetooth, usb, and uart implementations.

At a guess, I'd suggest seeing where the nrf_cli_t p_cli is assigned, and seeing what would be required to change that from usb to uart.

from logitacker.

mame82 avatar mame82 commented on June 30, 2024

The esb_illegalmod and cli_mod folders are copies from the nrf5 SDK, with required changes.

Tbh, I can't remember why I had to do changes to CLI implementation, but they shouldn't be "invasive" (needs diffing, to find out what I did back then).

To be sure, just include the correct libs in the Makefile for your board. Again, the Makerdiary MDK file could serve as example. It includes the cli_uart lib (Makefiles for the 3 supported boards don't differ library-wise, but otherwise are tuned to the respective board)

https://github.com/RoganDawes/LOGITacker/blob/master/mdk/blank/armgcc/Makefile#L143

from logitacker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.