Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 978
» Latest member: barabek
» Forum threads: 857
» Forum posts: 5,090

Full Statistics

Latest Threads
Kinetis MK66 & SVD
Forum: SVD (System view) files
Last Post: Workalot
Yesterday, 10:05 AM
» Replies: 0
» Views: 23
Download/Debugging Silabs...
Forum: Debug interface scripting
Last Post: Polarisru
10-12-2018, 01:38 PM
» Replies: 4
» Views: 1,149
Burning flash and debuggi...
Forum: Debug interface scripting
Last Post: Polarisru
10-12-2018, 01:33 PM
» Replies: 0
» Views: 36
Embitz with GCC-ARM
Forum: ArmGCC - EmBlocks
Last Post: Tony201800
30-11-2018, 12:01 AM
» Replies: 0
» Views: 158
emBitz, MK66, Debugger an...
Forum: EmBitz IDE
Last Post: Workalot
27-11-2018, 10:40 AM
» Replies: 1
» Views: 190
EBLINK: STM32L496ZG not s...
Forum: Debug interface scripting
Last Post: vargham
22-11-2018, 09:36 AM
» Replies: 1
» Views: 385
warning: implicit declara...
Forum: ArmGCC - EmBlocks
Last Post: bbennett
17-11-2018, 09:02 PM
» Replies: 1
» Views: 191
Print diagnostic messages...
Forum: EmBitz IDE
Last Post: AVI-crak
13-11-2018, 03:27 PM
» Replies: 0
» Views: 152
The case for CAN
Forum: General
Last Post: DD4DA
02-11-2018, 11:09 AM
» Replies: 3
» Views: 667
Does Embitz support Emwin...
Forum: EmBitz IDE
Last Post: ray911
25-10-2018, 06:03 AM
» Replies: 2
» Views: 485

 
  Kinetis MK66 & SVD
Posted by: Workalot - Yesterday, 10:05 AM - Forum: SVD (System view) files - No Replies

Detective Workalot is on the trail of the misbehaving Kinetis MK66 SVD file.

The attached 'mk66_svd_issue.txt' expresses findings.


(Yesterday, 10:05 AM)Workalot Wrote: Detective Workalot is on the trail of the misbehaving Kinetis MK66 SVD file.

The attached 'mk66_svd_issue.txt' expresses findings.

Hmmm - where did the attachment get to?

Here is its content...

13-Dec-2018
-----------
Bogged down on why when debugging, the 'System Registers' window won't show
register values, reporting '(Target read error)'. However, some <peripheral>s
do show values.

For example the FTFE peripheral is reported (albeit incorrectly).

But some background. At...

    https://forum.segger.com/index.php/Threa...registers/

... I posed the question as to why peripheral registers could not be
viewed with JMEM. Well, JMEM reads in blocks and if there is a 'gap' in
the block addresses, the read fails. A 'gap' is an address where no
register exists.

Now I'm a wondering if this is the cause for '(Target read error)'. In the
case of FTFE peripheral, all registers are accessible including the reserved
registers. This was tested using the command line JLink utility...

    J-Link> mem8 0x40020000,0x2C    // Access entire space

... so, if one considers the SVD file for FTFE...

    <peripheral>
      <name>FTFE</name>
      <description>Flash Memory Interface</description>
      <prependToName>FTFE_</prependToName>
      <baseAddress>0x40020000</baseAddress>
      <addressBlock>
        <offset>0</offset>
        <size>0x2C</size>
        ......
     </peripheral>

... maybe '<size>0x2C</size>' has EmBitz instruct J-Link to read in 0x2C
bytes which is all good - there is no failure.

When we look at the PIT peripheral's layout however...

    /** PIT - Register Layout Typedef */
    typedef struct {
        __IO uint32_t MCR;
             uint8_t RESERVED_0[220];
        __I  uint32_t LTMR64H;
        __I  uint32_t LTMR64L;
             uint8_t RESERVED_1[24];
        struct {
            __IO uint32_t LDVAL;
            __I  uint32_t CVAL;
            __IO uint32_t TCTRL;
        __IO uint32_t TFLG;
        } CHANNEL[4];
    } PIT_Type;

... we find that a...

    J-Link>mem8 0x40037004,1    // PIT->RESERVED_0[0]

... fails with a 'Could not read memory'. So there is a 'gap' and the
read fails resulting in the PIT peripheral in the debug window showing
all '(Target read error)'s.

But, hang on, why does it not occur with other MCU platforms? EmBitz
is fine with SAM3X8E, STM32F407, LPC1837. Do they have contiguous
register space?

Print this item

  Burning flash and debugging for EFM32G222 and J-Link
Posted by: Polarisru - 10-12-2018, 01:33 PM - Forum: Debug interface scripting - No Replies

Hello,
I'm using EmBitz for some years already and is very satisfied with this IDE. I've already successfully worked with different families of MCUs (STM32F1/F4, Nordic nRF51822, Atmel ATSAMC21) and haven't had any problems with debugging and flashing controllers with ST-Link or J-link.
But now I want to start with EFM32 Gecko family from SiLabs and have a lot of problems with flashing these chips. I can actually flash them outside of EmBitz (with the native tool from Segger) and then everything is working, I can debug my firmware with EmBitz. But it seems not to be possible to flash chips with the EmBitz script. I have taken a look at the script, it seems to be the same script as the one for NXP, I've not found any serious differences. But it doesn't work. It can't enter the programming mode but is able to debug the chip. I have tried to change some settings but without any success.
May be somebody has solved this problem?
With best regards, Alex

Print this item

  Embitz with GCC-ARM
Posted by: Tony201800 - 30-11-2018, 12:01 AM - Forum: ArmGCC - EmBlocks - No Replies

Hello friends,

My apologies if this thread was already quizzed and answered. I am involved in a DIY project which includes bare metal dev on Pi 3 B+. I have downloaded and installed embitz 1.11 on WIndows 10. I also have a toolchain from ARM named: GCC-ARM-8.2-2018.08-x86_64-aarch64-elf.tar.xz.

I understand it's a toolchain for the linux platform. I would like to know how to get embitz configured to use this toolchain on WIndows 10. Is it even possible. I saw a youtube video where the presenter did what I am trying to do except that his toolchain was gcc-linux-arm.

If what I am trying to achieve is even remotely possible could someone please guide me of what I need to do to setup my environment.

Thanks,
Tony

Print this item

  emBitz, MK66, Debugger and Source Code Syncing
Posted by: Workalot - 21-11-2018, 12:39 AM - Forum: EmBitz IDE - Replies (1)

Have built a project based on NXP's MK66 MCU. I can download the program but the debugger brings up the wrong C source code (normally it would be the reset handler function or the main() function).

The Disassembly window however does show stepping through the reset handler code. 

"Debug->Interfaces->GDB server.Device family: generic".
"Debug->Interfaces->GDB server->Settings->Connect/Reset: -select USB -device MK66FN2M0xxx18 -if SWD -speed auto".
"Debug->Interfaces->GDB server->Settings->After connect: monitor reset <cr> load".

Even tried "Debug->Interfaces->GDB server->Settings->Before connect: dir ..\Source" to locate the startup file and main.c.

Workalot.

Print this item

  warning: implicit declaration of function 'memset'
Posted by: bbennett - 17-11-2018, 05:29 PM - Forum: ArmGCC - EmBlocks - Replies (1)

src\main.c|66|warning: implicit declaration of function 'memset' [-Wimplicit-function-declaration]|

I am using a nucleo F401RE with an ST x-nucleo-nfc03a1 (RFID board)
Also, I've been converting the code available from ST to the 401RE.

here is my main :
#include "stm32f4xx_conf.h"
#include "string.h"

typedef struct
{
  uint8_t one[5];
  uint8_t two[23];


}TEST;

int main(void)
{

  uint8_t check[10];
  memset(check, '=', 7);

  //TEST test;
  //memset(test.one, '-', 3);

  while(1)
  {

  }
}

The code used for driving the RFID board has been commented out and I am left with only the memset which by the way throws the warning.
Searching through all the headers reveal nothing out of the ordinary to me. Also I've searched through the .depend, .epb, and .elay files for clues. Again, everything looks copacetic.

For grins, I made a simple test project simply calling memset in the main and compiling worked without a hitch.

Mostly looking for guidance. Thanks in advance for all questions and comment.

bri

Print this item

  Print diagnostic messages in any form.
Posted by: AVI-crak - 13-11-2018, 03:27 PM - Forum: EmBitz IDE - No Replies

https://bitbucket.org/AVI-crak/sprint
Size - 1907 bytes with aggressive optimization - much easier and simpler printf ().
Print without parameter type, 1-4 arguments in arbitrary order.
No dependencies on external libraries.
Recognizes: "text", double, float, uint (8-16-32-64) _t, int (8-16-32-64) _t.
The text is printed without abbreviations.
Variables are limited by the number of characters OUT_TXT_SIZE_FLOATING (8-16).

Function to use in user code (macro)
printo ("text"); printo ( 0,566f, "text", 123, "/n/t");

The taste and color can change the contents of the function soft_print (char * txt).
This function prints on physics.

Print this item

Question Does Embitz support Emwin?
Posted by: ray911 - 19-10-2018, 07:51 AM - Forum: EmBitz IDE - Replies (2)

MCU:STM32F429IGT6
OS: none
LCD:5" 800x480  RGB888

Hi~
I recently learned to use a touch screen LCD with emWin Library.
But after adding the library file to Embitz, (Project build options---Linker settings---Libraries---Add---libgui.a)
it seems that there are many errors,
Am I made a mistake? or Embitz does not support it?


emWin Library file:
https://github.com/jserv/stm32f429-lcd-d...ry522_4x9i


emWin\Config\GUIConf.c|83|warning: 'at' attribute directive ignored [-Wattributes]|
||bin\Debug\emwinMove.elf uses VFP register arguments, emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(WINDOW.o) does not|
||failed to merge target specific data of file emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(WINDOW.o)|
||bin\Debug\emwinMove.elf uses VFP register arguments, emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(WIDGET.o) does not|
||failed to merge target specific data of file emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(WIDGET.o)|
||bin\Debug\emwinMove.elf uses VFP register arguments, emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(SPINBOX_CreateIndirect.o) does not|
||failed to merge target specific data of file emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(SPINBOX_CreateIndirect.o)|
||bin\Debug\emwinMove.elf uses VFP register arguments, emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(SPINBOX.o) does not|
||failed to merge target specific data of file emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(SPINBOX.o)|
||bin\Debug\emwinMove.elf uses VFP register arguments, emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(SLIDER_CreateIndirect.o) does not|
||failed to merge target specific data of file emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(SLIDER_CreateIndirect.o)|
||bin\Debug\emwinMove.elf uses VFP register arguments, emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(SLIDER.o) does not|
||failed to merge target specific data of file emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(SLIDER.o)|
||bin\Debug\emwinMove.elf uses VFP register arguments, emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(SCROLLBAR_CreateIndirect.o) does not|
||failed to merge target specific data of file emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(SCROLLBAR_CreateIndirect.o)|
||bin\Debug\emwinMove.elf uses VFP register arguments, emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(SCROLLBAR.o) does not|
||failed to merge target specific data of file emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(SCROLLBAR.o)|
||bin\Debug\emwinMove.elf uses VFP register arguments, emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(RADIO_SetText.o) does not|
||failed to merge target specific data of file emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(RADIO_SetText.o)|
||bin\Debug\emwinMove.elf uses VFP register arguments, emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(RADIO_SetFont.o) does not|
||failed to merge target specific data of file emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(RADIO_SetFont.o)|
||bin\Debug\emwinMove.elf uses VFP register arguments, emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(RADIO_CreateIndirect.o) does not|
||failed to merge target specific data of file emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(RADIO_CreateIndirect.o)|
||bin\Debug\emwinMove.elf uses VFP register arguments, emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(RADIO.o) does not|
||failed to merge target specific data of file emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(RADIO.o)|
||bin\Debug\emwinMove.elf uses VFP register arguments, emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(LISTBOX_Font.o) does not|
||failed to merge target specific data of file emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(LISTBOX_Font.o)|
||bin\Debug\emwinMove.elf uses VFP register arguments, emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(LISTBOX_CreateIndirect.o) does not|
||failed to merge target specific data of file emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(LISTBOX_CreateIndirect.o)|
||bin\Debug\emwinMove.elf uses VFP register arguments, emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(LISTBOX.o) does not|
||failed to merge target specific data of file emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(LISTBOX.o)|
||bin\Debug\emwinMove.elf uses VFP register arguments, emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(GUI_ARRAY.o) does not|
||failed to merge target specific data of file emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(GUI_ARRAY.o)|
||bin\Debug\emwinMove.elf uses VFP register arguments, emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(FRAMEWIN_CreateIndirect.o) does not|
||failed to merge target specific data of file emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(FRAMEWIN_CreateIndirect.o)|
||bin\Debug\emwinMove.elf uses VFP register arguments, emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(FRAMEWIN.o) does not|
||failed to merge target specific data of file emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(FRAMEWIN.o)|
||bin\Debug\emwinMove.elf uses VFP register arguments, emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(EDIT_SetCursorAtChar.o) does not|
||failed to merge target specific data of file emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(EDIT_SetCursorAtChar.o)|
||bin\Debug\emwinMove.elf uses VFP register arguments, emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(EDIT_EnableBlink.o) does not|
||failed to merge target specific data of file emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(EDIT_EnableBlink.o)|
||bin\Debug\emwinMove.elf uses VFP register arguments, emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(EDIT_Default.o) does not|
||failed to merge target specific data of file emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(EDIT_Default.o)|
||bin\Debug\emwinMove.elf uses VFP register arguments, emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(EDITDec.o) does not|
||failed to merge target specific data of file emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(EDITDec.o)|
||bin\Debug\emwinMove.elf uses VFP register arguments, emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(EDIT.o) does not|
||failed to merge target specific data of file emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(EDIT.o)|
||bin\Debug\emwinMove.elf uses VFP register arguments, emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(DROPDOWN_SetFont.o) does not|
||failed to merge target specific data of file emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(DROPDOWN_SetFont.o)|
||bin\Debug\emwinMove.elf uses VFP register arguments, emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(DROPDOWN_CreateIndirect.o) does not|
||failed to merge target specific data of file emWin\Lib\STemWin522_4x9i_CM4_OS_GCC.a(DROPDOWN_CreateIndirect.o)|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 1 warnings (0 minutes, 39 seconds) ===|

Print this item

  crash sequence identified
Posted by: jheissjr - 17-09-2018, 03:08 PM - Forum: EmBitz IDE - Replies (1)

I identified a sequence of Embitz crashing. It is reproducible on my side. What info is helpful besides the capture?

https://youtu.be/FEVFBXLL4XY



Attached Files Thumbnail(s)
   

.txt   crashrpt.txt (Size: 1.63 KB / Downloads: 32)
Print this item

  The case for CAN
Posted by: smitjs - 01-09-2018, 11:27 AM - Forum: General - Replies (3)

I have been working on various new machines, planters, fire engines, etc for years.
There never was any question, distributed computing was always used. At first 8085 types, then Atmel 328 was used, mainly due to the avalability of Arduino Nano boards and WinAVR.
The AVR does work, but debugging is sadly lacking. I have also used Raspi, and was disgusted with the bootup sequence. That is totally out of the question.
Why use such a horrible operating system on any machine? Nobody wants to wait that long for any machine to start working.
ARM boards became available, and I switched to STM32F103 initially, using Embitz. What a marvellous upgrade! Embitz and the EBmoitor is absolutely marvellous!
Why struggle with AVR? The STM32 units are cheap enough.
The first consideration then is what interconnection type to use between units.
I did use serial in the form of RS485. All micros I used have serial, and it is always easy to add another bit bang one. The problem with a RS485 setup is that it is a master - slave setup.
For fast response, the master has to poll often, resulting in micros spending time looking at serial, while neglecting its real work.
The STM32 units can receive serial without using processor time, but the problem of fast transmit response remain. DMA does not do it for short massages.
I have used Ethernet with the Raspis, disasterly. Those sockets are simply horrible in a moving and shaking machine.
Essentially, any master slave setup is not the best. It has to be multimaster, minimum wiring, and no collisions.
No wonder canbus is used so widely. It is really the answer.
It appears all the STM32 units has the provision for Canbus. It is easily applied, does not use processor time for receiving, and has numerous filters to block any unwanted messages.
To use the full Canbus specs, driver chips must be used, but canbus can even be used without that. See Siemens Appnote AP2921. Their one wire setup can  be extended simply by using LM393 comparators and higher voltage on the one wire. That will be the cheapest setup for longer connections.
Canbus will transmit when the bus becomes free, the processor only posts the txmessage.
Received messages are filtered and stored, the processor reads the messages when there is time available, no interrupts are required, and no unnecessary messages are received.
The filters only pass messages intended for the particular unit.
The initial code for a STM32F407 is
 //p1099 CAN master control register Page numbers refer to the STM32F407 reference manual
  CAN1->MCR &= (~(uint32_t)CAN_MCR_SLEEP); //wake up from sleep mode
  CAN1->MCR = (CAN_MCR_INRQ);       //p1083 init mode, disable auto retransmission//CAN_MCR_NART |
  uitime = uimillis + 500;
  while(!(CAN1->MSR & CAN_MSR_INAK)){assert(uimillis, <, uitime);} //p1083 wait for confirmation
 
Set up the baudrate

  //A good rule of thumb is to have your sampling point at 70-80% of the nominal bit time.
  //p1095 For 125Khz CAN: APB1 42Mhz;(APB1 clocked at 42 MHz)
  // quanta 1+9+4 = 14, 14 * 24 = 336, 42000000 / 336 = 125000
  // CAN Baudrate = 125Kbps (CAN clocked at 42 MHz) Prescale = 24

Code:
  CAN1->BTR  = 0x01 << 24; //p1108 CAN bit timing register  Resynchronization jump width
  CAN1->BTR |= 0x03 << 20; //TS2 tBS2 = tq x (TS2[2:0] + 1)p1108
  CAN1->BTR |= 0x08 << 16; //TS1 tBS1 = tq x (TS1[3:0] + 1)p1109
  CAN1->BTR |= 0x17;       //prescaler 24 p1109
  CAN1->FMR  = 0x0E << 8;   //p1116 CAN filter master register
This must be changed to the required speed and APB1 clock speed
Set up the receive filters

Code:
  CAN1->FMR  = 0x0E << 8;   //p1116 CAN filter master register
  CAN1->FMR |= 1;          //p1116 Initialization mode for the filters.
  CAN1->FM1R = 0;          //p1117 Filter mode register 1:32bit filters mask mode
  CAN1->FS1R  = 0x0FFFFFFF;//p1117 Single 32-bit scale configuration
  CAN1->FFA1R = 0x00000000;//p1118 Fifo assignment register
  CAN1->sFilterRegister[0].FR1 = 0x00B << 21;//p1091,1119 COMP
  CAN1->sFilterRegister[1].FR1 = 0x00D << 21;//p1091,1119 COMP
  CAN1->sFilterRegister[0].FR2 = 0x47F << 21;//p1091,1119 MASK
  CAN1->sFilterRegister[1].FR2 = 0x47F << 21;//p1091,1119 MASK
  CAN1->FA1R  = 0x00000001;//p1118 filter activation register filters 0 only
  CAN1->FMR   = 0x0E << 8; //p1116 CAN filter master register clear init bit
  CAN1->MCR &= ~(CAN_MCR_INRQ);// p1083 normal mode
  uitime = uimillis + 500;
  while(CAN1->MSR & CAN_MSR_INAK){assert(uimillis, <, uitime);};  //p1083 wait for confirmation

Set up a tx message struct

Code:
typedef struct
{ u16   id;                 // 11 bit identifier
  u8    data[8];            // Data field
  u8    len;                // Length of data field in bytes
  u8    format;             // 0 - STANDARD, 1- EXTENDED IDENTIFIER
  u8    type;               // 0 - DATA FRAME, 1 - REMOTE FRAME
}canmsg;
canmsg cantxmsg;

I found that most messages used were the 11bit id only, or id + 1. The full 8 bytes data was rarely used.
The transmit code:

Code:
  while(!(CAN1->TSR & (1 << 26)))//p1103 TME0 Mailbox empty
  {assert(uimillis, <, uitime);} //NAK?
  CAN1->sTxMailBox[0].TIR = 0;                     //p1110
  CAN1->sTxMailBox[0].TIR |= (txmsg->id << 21)|txmsg->type;
  CAN1->sTxMailBox[0].TDTR = (txmsg->len & 0x07);    //p1111
  if(0 == txmsg->len)
 { CAN1->sTxMailBox[0].TDLR = (txmsg->data[0]);
 }else if(1 == txmsg->len)
  { CAN1->sTxMailBox[0].TDLR = ((txmsg->data[1] << 8) |  (txmsg->data[0]));
  }else
  { CAN1->sTxMailBox[0].TDHR = ((txmsg->data[7] << 24) //p1112
                                 |(txmsg->data[6] << 16)
                                 |(txmsg->data[5] <<  8)
                                 |(txmsg->data[4]));
    CAN1->sTxMailBox[0].TDLR = ((txmsg->data[3] << 24)
                                 |(txmsg->data[2] << 16)
                                 |(txmsg->data[1] <<  8)
                                 |(txmsg->data[0]));
  }
  CAN1->sTxMailBox[0].TIR |= 0x01; //p1110 TXRQ

Receive is:

Code:
volatile u32 mail0 = 0;
    rxid = (((CAN1->sFIFOMailBox[0].RIR) >> 21) & 0x07ff);  //p1113 11 bits only (If you require the id in your code)
    datalen = (CAN1->sFIFOMailBox[0].RDTR) & 0x0F; //p1114
    //else if 0 datalen simply read CAN1->sFIFOMailBox[0].RIR
     mail0 = CAN1->sFIFOMailBox[0].RDLR;
      rxdata[0] = (mail0 & 0xFF);
      mail0 >>= 8;
      rxdata[1] = (mail0 & 0xFF);
      mail0 >>= 8;
      rxdata[2] = (mail0 & 0xFF);//p1115
      mail0 >>= 8;
      rxdata[3] = (mail0 & 0xFF);////p1115
      mail0 = CAN1->sFIFOMailBox[0].RDHR;
       rxdata[4] = (mail0 & 0xFF);////p1115
       mail0 >>= 8;
       rxdata[5] = (mail0 & 0xFF);////p1115
       mail0 >>= 8;
       rxdata[6] = (mail0 & 0xFF);////p1115
       mail0 >>= 8;
       rxdata[7] = (mail0 & 0xFF);//p1115
 Change as you like
The filters are not easy to envisage, but can easily be proven by this code:

Code:
  #define COMP 0x00D //change as required
  #define MASK 0x47F  //change as required
  u16 id= 0;
     for(id=0; id < 0x800; id++)
        {// printf("%d ",id);
            if ((id & MASK) == COMP)
           { printf("0x%03X\n", id);
           }
        }
Canbus is also easily tested in logic analysers.
I am not aware of anything that can beat canbus for interconnection.
I hope this post is of help to somebody.
Johan Smit

Print this item

  does Embitz have watchpoints
Posted by: jheissjr - 15-08-2018, 02:18 PM - Forum: EmBitz IDE - Replies (4)

I saw a tutorial on Mcuoneclipse.com discussing watchpoints in Eclipse and CDT. I have used them and they come in handy at times. Does EmBitz have watchpoints?

https://mcuoneclipse.com/2018/08/11/tuto...tchpoints/

Print this item