Hello everybody:

I'm using a nucleo-64 board (STM32L476) to interface it with an ENC28J60
transceiver (mounted on external pbc).

Hardware connection:
___________________________________
| NUCLEO-64      |            |ENC28J60 SBX |
| CN3: 3.3V          | <-----> | J1: VCC       |
| CN3: GND         | <----->  | J1: GND      |
| CN5: SCK/D13  | <----->  | J1: SCK       |
| CN5: MISO/D12 | <----->  | J1: SO         |
| CN5: MOSI/D11 | <----->  | J1: SI           |
| CN9: D7             | <----->  | J1: RESET   |
| CN9: D4             | <----->  | J1: CS          |
| CN9: D2              | <-----> | J1: INT         |

Please take a look to attached files:
[1] Makefile
[2] main

Goal:
I would assign it an IP address from my DHCP.

Problems:
ifconfig doesn't print anything (because iface == null) and the boot up
doesn't log errors
I think there's a problem with the ENC28J60 probing/registering, I don't
see any output of the driver when I turn on the debug MACRO of driver
enc28j60.
I need help.

Best,
Giuseppe.
2 allegati




-- 
[image: Risultati immagini per png twitter]
<http://s.bl-1.com/h/cKv1wMpv?url=https://twitter.com/Ciusss89>   [image:
Risultati immagini per png linkedin]
<http://s.bl-1.com/h/cKv1wRCx?url=https://www.linkedin.com/in/giuseppe-tipaldi-a3008835?trk=nav_responsive_tab_profile>
 *Giuseppe Tipaldi*
phone: +39 349 3118833
#include <errno.h>
#include <stdio.h>

#include "common.h"

#include "lwip.h"
#include "lwip/netif.h"
#include "net/ipv4/addr.h"

#include "shell.h"

#define ENABLE_DEBUG    1
#include "debug.h"

static int ifconfig(int argc, char **argv)
{
	/* Silent compiler Wunused */
	(void)argc;
	(void)argv;

	for (struct netif *iface = netif_list; iface != NULL;
	     iface = iface->next) {

	        printf("%s_%02u: ", iface->name, iface->num);

		#ifdef MODULE_LWIP_IPV4
		char addrstr[IPV4_ADDR_MAX_STR_LEN];
		printf(" inet %s\n", ipv4_addr_to_str(addrstr,
						     (ipv4_addr_t *)&iface->ip_addr,
						     sizeof(addrstr)));
		#endif
	}
	return 0;
}

static const shell_command_t shell_commands[] = {
    { "ifconfig", "Shows assigned IPv4 addresses", ifconfig },
    { NULL, NULL, NULL }
};

static char line_buf[SHELL_DEFAULT_BUFSIZE];

int main(void)
{
	DEBUG("[DEBUG]: ON\n");
	puts("[*] System started");
	shell_run(shell_commands, line_buf, SHELL_DEFAULT_BUFSIZE);

    /* should be never reached */
    return 0;
}

Attachment: Makefile
Description: Binary data

_______________________________________________
users mailing list
[email protected]
https://lists.riot-os.org/mailman/listinfo/users

Reply via email to