About the CAN controller.

ESP_Sprite
Posts: 1113
Joined: Thu Nov 26, 2015 4:08 am

Re: About the CAN controller.

Postby ESP_Sprite » Wed Mar 22, 2017 4:02 am

Rudi: That would be the choice of the author of that driver. If he wants, he can file a pull request in the esp-idf github and we'll check the code quality and such and if that's OK, we will integrate it into esp-idf. If he prefers to have the driver as a separate component, that is fine too.

User avatar
rudi ;-)
Posts: 1089
Joined: Fri Nov 13, 2015 3:25 pm
Contact:

Re: About the CAN controller.

Postby rudi ;-) » Wed Mar 22, 2017 8:08 am

Hans Dorn wrote:I know the theoretical throughput ;)

At 1MBit you should be able to push out a little less than 8000 frames per second.

Did you really see 20 - 50 ms between frames, or are these µs?

Still a lot, considering a fast frame is only a bit more than 100µs...


Cheers
Hans

sry for confusion,
here in a test, that i can see the messages on receiver side with printf,
i have a delay in code between next send, sure you can have lees value of delay in the "house-can-bus or openCAN end firmware :P :

Code: Select all

void task_CAN_TX(void* pvParameters) {
   
   CAN_frame_t __TX_frame;
   uint32_t counter = 0;
      
      __TX_frame.MsgID = 0x264;
      __TX_frame.DLC   =  8;
      __TX_frame.data.u8[0] = 'E';
      __TX_frame.data.u8[1] = 'S';
      __TX_frame.data.u8[2] = 'P';
      __TX_frame.data.u8[3] = '-';       
      __TX_frame.data.u8[4] = 'C';       
      __TX_frame.data.u8[5] = 'A';       
      __TX_frame.data.u8[6] = 'N';    
      __TX_frame.data.u8[7] = counter;
         
while(1) {
      __TX_frame.data.u8[7] = counter;
      CAN_write_frame(&__TX_frame);
      vTaskDelay( 50 / portTICK_PERIOD_MS);  // to see ( printf on receiver side ) what happend..
      counter++;
      if (counter >= 256) counter = 0;
  }
}


best wishes
rudi ;-)
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

User avatar
rudi ;-)
Posts: 1089
Joined: Fri Nov 13, 2015 3:25 pm
Contact:

Re: About the CAN controller.

Postby rudi ;-) » Wed Mar 22, 2017 8:36 am

ESP_Sprite wrote:Rudi: That would be the choice of the author of that driver. If he wants, he can file a pull request in the esp-idf github and we'll check the code quality and such and if that's OK, we will integrate it into esp-idf. If he prefers to have the driver as a separate component, that is fine too.


no problem with the author jeroen, he did pleased me too comments and make it ready for the structure of ESP-IDF as driver so that we can add according to guidelines. with little changes and menuconfig gaves the CAN Driver at last the finnish and is now ready,
as Driver in ESP-IDF or/and third party and a example code is ready too.
..
i do next time create a repo for this, upload it for people how wants use it yet with menuconfig,
i do then make a PR to the author repo as "third party", then the author can make a PR to ESP-IDF repo or "third party"
why this a little confuse is, the author willl have no access to a computer for the next weeks....nothing creepy
and i can not add Contributor License Agreement things in order of espressif.. cause have not the legal capacity to create contracts in Espressifs name.

so the author then can confirm later itself Contributor License Agreement if he makes the PR.

best wishes
rudi ;-)
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

DL88AI88
Posts: 26
Joined: Mon Aug 29, 2016 8:26 am

Re: About the CAN controller.

Postby DL88AI88 » Wed Mar 22, 2017 12:32 pm

Hi there,

I tried to compile the previously named CAN example

I get an error like this:
...
/ESP32-CAN/main///main.c:102:1: fatal error: opening dependency file //main.d: Permission denied
...

Is there further configuration of the source file needed?

Best regards

DL88AI88

User avatar
rudi ;-)
Posts: 1089
Joined: Fri Nov 13, 2015 3:25 pm
Contact:

Re: About the CAN controller.

Postby rudi ;-) » Wed Mar 22, 2017 1:41 pm

DL88AI88 wrote:I get an error like this:
...
/ESP32-CAN/main///main.c:102:1: fatal error: opening dependency file //main.d: Permission denied
...

Is there further configuration of the source file needed?



hi
if you work in a VM which os you use as host and which os you use as gast?
if you in a OS, in which os you work?

best wishes
rudi

$ make -j5 all
Building partitions from /c/idf/2114/components/partition_table/partitions_singleapp.csv...
CC bt.o
CC esp_ota_ops.o
CC src/bootloader_random.o
CC libcoap/src/address.o
AR libbt.a
CC src/flash_encrypt.o
CC libcoap/src/async.o
CXX cxx_guards.o
AR libapp_update.a
CC src/esp_image_format.o
CC rtc_module.o
CC src/flash_partitions.o
CC libcoap/src/block.o
CC src/secure_boot_signatures.o
CC i2c.o
CC libcoap/src/coap_time.o
CC src/secure_boot.o
CC src/efuse.o
CC libcoap/src/debug.o
CC src/bootloader_flash.o
CC sdmmc_host.o
AR libbootloader_support.a
CC libcoap/src/encode.o
AR libcxx.a
CC src/bootloader_random.o
CC timer.o
CC int_wdt.o
CC libcoap/src/hashkey.o
CC libcoap/src/mem.o
CC brownout.o
CC emac_main.o
CC src/flash_encrypt.o
CC sdmmc_transaction.o
CC system_api.o
CC libcoap/src/net.o
CC src/esp_image_format.o
CC rmt.o
CC hw_random.o
CC emac_dev.o
CC src/flash_partitions.o
CC cpu_freq.o
CC src/secure_boot_signatures.o
AR libethernet.a
CC pcnt.o
CC libcoap/src/option.o
CC event_loop.o
CC src/secure_boot.o
CC core_dump.o
CC libcoap/src/pdu.o
CC src/efuse.o
CC gpio.o
CC library/xmltok_impl.o
CC src/bootloader_flash.o
CC intr_alloc.o
CC libcoap/src/resource.o
CC library/xmlrole.o
AR libbootloader_support.a
CC ledc.o
CC ipc.o
CC libcoap/src/str.o
CC library/xmlparse.o
CC log.o
CC freertos_hooks.o
CC libcoap/src/subscribe.o
CC periph_ctrl.o
CC heap_alloc_caps.o
AR liblog.a
CC libcoap/src/uri.o
CC i2s.o
CC deep_sleep.o
CC port/coap_io_socket.o
CC uart.o
CC phy_init.o
CC library/xmltok.o
CC spi_flash_rom_patch.o
CC crosscore_int.o
AR libcoap.a
AR libspi_flash.a
CC sigmadelta.o
CC cpu_util.o
CC spi_master.o
CC gdbstub.o
CC micro-ecc/uECC.o
CC lib_printf.o
CC cpu_start.o
CC src/option/unicode.o
AR libdriver.a
CC library/xmltok_ns.o
AR libmicro-ecc.a
CC src/option/syscall.o
CC task_wdt.o
CC port/chardata.o
CC xtensa_overlay_os_hook.o
CC flash_qio_mode.o
CC src/diskio.o
CC event_default_handlers.o
CC FreeRTOS-openocd.o
CC port/expat_element.o
CC bootloader_start.o
CC src/vfs_fat.o
CC timers.o
CC port/minicheck.o
CC panic.o
CC tasks.o
AR libmain.a
CC src/vfs_fat_sdmmc.o
AR libexpat.a
CC hwcrypto/aes.o
CC hwcrypto/sha.o
CC src//jsmn.o
CC src/ff.o
LD bootloader.elf
CC event_groups.o
AR libjsmn.a
AR libesp32.a
CC heap_regions.o
CC log.o
AR libfatfs.a
CC library/cJSON.o
AR liblog.a
CC port.o
esptool.py v2.0-beta2
CC xtensa_init.o
CC mdns.o
CC port/cJSON_Utils.o
CC list.o
CC apps/dhcpserver.o
CC croutine.o
AR libjson.a
CC queue.o
CC micro-ecc/uECC.o
CC library/havege.o
CC xtensa_intr.o
CC heap_regions_debug.o
AR libmicro-ecc.a
AR libmdns.a
CC library/ssl_cookie.o
CC core/tcp_out.o
CC ringbuf.o
CC locks.o
CC syscall_table.o
CC core/udp.o
AS portasm.o
CC library/md5.o
AS xtensa_vectors.o
CC syscalls.o
CC core/def.o
CC library/nghttp2_map.o
CC library/certs.o
CC reent_init.o
AS xtensa_context.o
CC core/timers.o
CC time.o
CC library/ssl_ciphersuites.o
CC library/nghttp2_submit.o
AS xtensa_intr_asm.o
AR libfreertos.a
CC library/camellia.o
AR libnewlib.a
CC core/stats.o
CXX src/nvs_api.o
CC core/netif.o
CC library/x509_crl.o
CC library/nghttp2_queue.o
CC library/ssl_stack.o
CC core/pbuf.o
CC library/nghttp2_pq.o
CC library/threading.o
CC library/aesni.o
CC library/nghttp2_hd_huffman_data.o
CC library/ssl_lib.o
CC library/bignum.o
CC core/tcp_in.o
CC library/nghttp2_outbound_item.o
CC library/ssl_x509.o
CC library/arc4.o
CC library/nghttp2_frame.o
CC core/raw.o
CC library/ssl_pkey.o
CC library/cipher_wrap.o
CC core/ip.o
CC library/ssl_methods.o
CC library/nghttp2_helper.o
CXX src/nvs_storage.o
CC library/aes.o
CC core/dns.o
CC library/ssl_cert.o
CC library/nghttp2_npn.o
CC library/xtea.o
CC platform/ssl_port.o
CC library/nghttp2_option.o
CC core/tcp.o
CC library/base64.o
CC platform/ssl_pm.o
CC library/nghttp2_buf.o
CC core/sys.o
CC library/sha512.o
CC library/pkcs11.o
CC library/nghttp2_priority_spec.o
CC core/memp.o
AR libopenssl.a
CC library/asn1write.o
CC library/nghttp2_hd.o
CXX src/nvs_pagemanager.o
CC sdmmc_cmd.o
CC core/init.o
CC library/oid.o
AR libsdmmc.a
CC core/inet_chksum.o
CC library/ecjpake.o
CC library/nghttp2_stream.o
CC core/mem.o
CC library/ssl_tls.o
CXX src/nvs_item_hash_list.o
CC library/nghttp2_session.o
CC api/lwip_debug.o
CC api/sockets.o
CXX src/nvs_page.o
CC flash_ops.o
CC library/debug.o
CC library/net.o
CC library/ecdh.o
CC api/api_msg.o
CXX src/nvs_types.o
CC library/nghttp2_callbacks.o
CC cache_utils.o
CC library/x509_crt.o
CC library/nghttp2_rcbuf.o
CC api/err.o
CC spi_flash_rom_patch.o
CC library/nghttp2_hd_huffman.o
AR libnvs_flash.a
CC api/netbuf.o
CC library/ssl_srv.o
CC partition.o
CC tcpip_adapter_lwip.o
CC library/nghttp2_mem.o
CC api/tcpip.o
CC library/nghttp2_version.o
CC flash_mmap.o
CC api/netifapi.o
AR libtcpip_adapter.a
CC library/ecdsa.o
CC library/nghttp2_http.o
CC api/api_lib.o
AR libspi_flash.a
CC library/md2.o
CC port/http_parser.o
CC ulp.o
CC vfs.o
CC library/x509_create.o
CC api/netdb.o
CC vfs_uart.o
AR libulp.a
CC library/memory_buffer_alloc.o
AR libvfs.a
CC api/pppapi.o
CC library/gcm.o
CC apps/sntp/sntp.o
AR libnghttp.a
CC trax.o
CC library/version.o
CC src/crypto/ms_funcs.o
CC eri.o
CC apps/ping/esp_ping.o
CC library/pem.o
AR libxtensa-debug-module.a
CC apps/ping/ping.o
CC src/crypto/crypto_internal-cipher.o
CC library/padlock.o
CC core/ipv4/icmp.o
CC library/asn1parse.o
CC src/crypto/crypto_internal-modexp.o
CC core/ipv4/autoip.o
CC library/timing.o
CC src/crypto/bignum.o
CC core/ipv4/ip4.o
CC library/ssl_cli.o
CC library/pkwrite.o
CC core/ipv4/igmp.o
CC src/crypto/sha1-pbkdf2.o
CC core/ipv4/ip4_addr.o
CC library/ssl_cache.o
CC src/crypto/aes-cbc.o
CC core/ipv4/dhcp.o
CC library/sha256.o
CC src/crypto/md5.o
CC library/md_wrap.o
CC core/ipv4/ip_frag.o
CC src/crypto/rc4.o
CC core/ipv6/icmp6.o
CC library/entropy.o
CC src/crypto/sha256.o
CC core/ipv6/ethip6.o
CC core/ipv6/mld6.o
CC library/md.o
CC src/crypto/dh_groups.o
CC core/ipv6/nd6.o
CC core/ipv6/ip6.o
CC library/rsa.o
CC src/crypto/md4-internal.o
CC core/ipv6/ip6_addr.o
CC src/crypto/sha1-internal.o
CC library/ripemd160.o
CC core/ipv6/inet6.o
CC core/ipv6/dhcp6.o
CC core/ipv6/ip6_frag.o
CC src/crypto/aes-wrap.o
CC netif/ethernetif.o
CC library/version_features.o
CC src/crypto/crypto_internal.o
CC netif/lowpan6.o
CC netif/ethernet.o
CC library/cipher.o
CC netif/etharp.o
CC src/crypto/dh_group5.o
CC netif/slipif.o
CC port/freertos/sys_arch.o
CC src/crypto/des-internal.o
CC library/entropy_poll.o
CC port/netif/ethernetif.o
CC src/crypto/crypto_internal-rsa.o
CC port/netif/wlanif.o
CC library/dhm.o
CC src/crypto/aes-unwrap.o
AR liblwip.a
CC library/error.o
CC src/crypto/aes-internal-dec.o
CC src/crypto/sha1.o
CC src/crypto/aes-internal.o
CC library/ssl_ticket.o
CC library/x509.o
CC src/crypto/md5-internal.o
CC src/crypto/sha256-internal.o
CC library/blowfish.o
CC library/ecp.o
CC src/crypto/aes-internal-enc.o
CC library/md4.o
CC port/os_xtensa.o
CC library/x509_csr.o
CC library/pkparse.o
AR libwpa_supplicant.a
CC library/pkcs5.o
CC library/ccm.o
CC library/pkcs12.o
CC library/pk_wrap.o
CC library/ecp_curves.o
CC library/x509write_crt.o
CC library/ctr_drbg.o
CC library/platform.o
CC library/pk.o
CC library/x509write_csr.o
CC library/des.o
CC library/hmac_drbg.o
CC library/sha1.o
CC port/esp_sha512.o
CC port/esp_hardware.o
CC port/esp_bignum.o
CC port/esp_sha256.o
CC port/net.o
CC port/esp_sha1.o
CC port/mbedtls_debug.o
AR libmbedtls.a
CC //main.o
CC drv/CAN/CAN.o
CC drv/CAN/cfg/CAN_config.o
AR libmain.a
LD CAN_demo.elf
esptool.py v2.0-beta2
To flash all build output, run 'make flash' or:
python /c/idf/2114/components/esptool_py/esptool/esptool.py --chip esp32 --port com21 --baud 921600 --before default_reset --after hard_reset write_flash -u --flash_mode dio --flash_freq 40m --flash_size detect 0x1000 /home/sysop/testcan/build/bootloader/bootloader.bin 0x10000 /home/sysop/testcan/build/CAN_demo.bin 0x8000 /home/sysop/testcan/build/partitions_singleapp.bin
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

DL88AI88
Posts: 26
Joined: Mon Aug 29, 2016 8:26 am

Re: About the CAN controller.

Postby DL88AI88 » Wed Mar 22, 2017 10:54 pm

No vm.
Just Ubuntu Linux 16.10.

All other examples are being built without issues.

best regards

DL88AI88

DL88AI88
Posts: 26
Joined: Mon Aug 29, 2016 8:26 am

Re: About the CAN controller.

Postby DL88AI88 » Thu Mar 23, 2017 10:54 am

OK, I solved it like this:

in component.mk I changed

COMPONENT_ADD_INCLUDEDIRS := / drv/CAN/include
COMPONENT_SRCDIRS := / drv/CAN drv/CAN/cfg

to

COMPONENT_ADD_INCLUDEDIRS := . drv/CAN/include
COMPONENT_SRCDIRS := . drv/CAN drv/CAN/cfg


Now it compiles.
:)

best regards

DL88AI88

User avatar
rudi ;-)
Posts: 1089
Joined: Fri Nov 13, 2015 3:25 pm
Contact:

Re: About the CAN controller.

Postby rudi ;-) » Sat Mar 25, 2017 4:55 pm

ESP_Sprite wrote:
Rudi: That would be the choice of the author of that driver. If he wants, he can file a pull request in the esp-idf github and we'll check the code quality and such and if that's OK, we will integrate it into esp-idf. If he prefers to have the driver as a separate component, that is fine too.



@jeroen

CAN Driver as component and menuconfig now online on my git

Pullrequest to the author is done

extended frames in work

best wishes
rudi ;-)
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

Hans Dorn
Posts: 62
Joined: Tue Feb 21, 2017 2:21 am

Re: About the CAN controller.

Postby Hans Dorn » Sat Mar 25, 2017 5:33 pm

Nice.

Dont't forget about those pesky RTR frames :P

Cheers

User avatar
rudi ;-)
Posts: 1089
Joined: Fri Nov 13, 2015 3:25 pm
Contact:

Re: About the CAN controller.

Postby rudi ;-) » Sat Mar 25, 2017 6:07 pm

Hans Dorn wrote:Nice.
Dont't forget about those pesky RTR frames :P

:D
german

http://translate.google.com

english

best wishes
rudi ;-)
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

Who is online

Users browsing this forum: No registered users and 1 guest