Re: Canopen node nRF52832


Bolivar, Marti
 

Hi,

The MPU fault may be due to a missing CONFIG_MPU_ALLOW_FLASH_WRITE=y.

I don't know anything about CAN, though :).

Martí

"Cristian Anceschi via lists.zephyrproject.org"
<cristian.anceschi=galileo.engineering@lists.zephyrproject.org> writes:

Hi all

I'm quite new on Zephyr and on CAN BUS so my question might have an easy or
obvious answer.

I'm on Ubuntu and I'm using an nRF52DK nRF52832 (PCA10040) wired to a
custom board equipped with a MCP2515 and a MCP2551 devices.

Is the samples\subsys\canbus\canopen suitable for an hardware like the one
I'm using?
If so, any hints on how make this sample working?

1)
I can compile it from command line with
west build -b nrf52dk_nrf52832 samples\subsys\canbus\canopen
-DSHIELD=dfrobot_can_bus_v2_0 -DCONF_FILE=prj.mcp2515.conf

declaring in subsys\canbus\canopen\CO_driver.c (even though I thought it
wasn't really need to declare this here)
#define CONFIG_CAN_MAX_FILTER 13

and prj.mcp2515.conf as attachment

Executing the project, I get the attached log file with a series of error
messages and this stucks me here for this moment.

2)
Just to give some more info, I'd like to say that I did compile the
samples/drivers/can from command line launching this

west build -b nrf52dk_nrf52832 samples/drivers/can/
-DSHIELD=dfrobot_can_bus_v2_0 -DCONF_FILE=prj.mcp2515.conf

and everything works as expected (tested using a CAN sniffer).
But it is not clear to me how to add in this project the CANOpen stack
library.

Thanks in advance for the support

Kind regards
Crisian



--
Ing Cristian Anceschi
Galileo Engineering s.r.l.
Via Cavallotti 16
IT - 42122 Reggio Emilia
Phone +39 0522 920496 / +39 0522 516244
Fax +39 0522 920496 / +39 0522 516244

Privacy - Le informazioni contenute nel presente messaggio di posta
elettronica ed in ogni allegato sono da ritenersi informazioni riservate.
Chi ricevesse il presente messaggio senza esserne l'effettivo destinatario
è rigorosamente tenuto a evitarne ogni divulgazione, diffusione o
riproduzione, ai sensi del D.Lgs n.196/2003. Qualora abbiate ricevuto la
presente comunicazione per errore siete pregati di distruggerla e di
segnalarlo al mittente. Grazie.

Privacy - The information contained in this e-mail message and any attached
files are considered private information. If you have received this message
without being the intended recipient, prevent any dissemination or
reproduction. If you are not the addressee, please contact the sender and
destroy all copies of the original message. Thanks.





# Alternate conf file required for building the CAN sample for the
# MCP2515 stand alone CAN controller

CONFIG_GPIO=y

CONFIG_CAN=y
CONFIG_CAN_INIT_PRIORITY=80
CONFIG_CAN_MCP2515_MAX_FILTER=5

CONFIG_SHELL=y
CONFIG_CAN_SHELL=y
CONFIG_DEVICE_SHELL=y


CONFIG_LOG=y
CONFIG_PRINTK=y
CONFIG_CONSOLE=y
#CONFIG_LOG_PRINTK=y
CONFIG_RTT_CONSOLE=y
#CONFIG_HAS_SEGGER_RTT=y
CONFIG_USE_SEGGER_RTT=y

#

CONFIG_LOG=y
CONFIG_CANOPEN_LOG_LEVEL_DBG=y

CONFIG_CAN=y
CONFIG_CAN_INIT_PRIORITY=80
CONFIG_CAN_MCP2515=y
CONFIG_CAN_MAX_FILTER=13


CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SETTINGS=y
CONFIG_SETTINGS_NVS=y

CONFIG_CANOPEN=y
CONFIG_CANOPEN_SYNC_THREAD=y
CONFIG_CANOPEN_STORAGE=y
CONFIG_CANOPEN_LEDS=y

CONFIG_REBOOT=y
canstat=0
new mode value : 0
init mode 0
*** Booting Zephyr OS version 2.4.99 ***
[00:00:00.413,665] <inf> fs_nvs: 6 Sectors of 4096 bytes
[00:00:00.413,665] <inf> fs_nvs: alloc wra: 0, ff0
[00:00:00.413,665] <inf> fs_nvs: data wra: 0, 0
[00:00:00.413,726] <dbg> canopen_driver.CO_CANmodule_init: rxSize = 13, txSize = 9
canstat=0
new mode value : 0
[00:00:00.414,978] <err> canopen_driver: failed to attach CAN rx isr, no free filter
[00:00:00.415,039] <err> canopen_driver: failed to attach CAN rx isr, no free filter
[00:00:00.415,069] <err> canopen_driver: failed to attach CAN rx isr, no free filter
[00:00:00.415,130] <inf> app: CANopen stack initialized
[00:00:00.415,527] <err> os: ***** MPU FAULT *****
[00:00:00.415,527] <err> os: Data Access Violation
[00:00:00.415,527] <err> os: MMFAR Address: 0x7a000
[00:00:00.415,557] <err> os: r0/a1: 0x0007a000 r1/a2: 0x00000055 r2/a

Join devel@lists.zephyrproject.org to automatically receive all group messages.